Revision aa2c91bd
b/blockdev.c | ||
---|---|---|
532 | 532 |
dinfo->unit = unit_id; |
533 | 533 |
dinfo->opts = opts; |
534 | 534 |
dinfo->refcount = 1; |
535 |
if (serial) |
|
536 |
strncpy(dinfo->serial, serial, sizeof(dinfo->serial) - 1); |
|
535 |
if (serial) { |
|
536 |
pstrcpy(dinfo->serial, sizeof(dinfo->serial), serial); |
|
537 |
} |
|
537 | 538 |
QTAILQ_INSERT_TAIL(&drives, dinfo, next); |
538 | 539 |
|
539 | 540 |
bdrv_set_on_error(dinfo->bdrv, on_read_error, on_write_error); |
b/hw/ide/core.c | ||
---|---|---|
1879 | 1879 |
} |
1880 | 1880 |
} |
1881 | 1881 |
if (serial) { |
1882 |
strncpy(s->drive_serial_str, serial, sizeof(s->drive_serial_str));
|
|
1882 |
pstrcpy(s->drive_serial_str, sizeof(s->drive_serial_str), serial);
|
|
1883 | 1883 |
} else { |
1884 | 1884 |
snprintf(s->drive_serial_str, sizeof(s->drive_serial_str), |
1885 | 1885 |
"QM%05d", s->drive_serial); |
Also available in: Unified diff