mirror of https://github.com/xqemu/xqemu.git
Avoid a warning from OpenBSD linker
Avoid the warning below by using snprintf: ../libhw64/vl.o(.text+0x78d4): In function `get_boot_devices_list': /src/qemu/vl.c:763: warning: sprintf() is often misused, please use snprintf() Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
d41160a3e6
commit
4fd37a98d1
6
vl.c
6
vl.c
|
@ -759,8 +759,10 @@ char *get_boot_devices_list(uint32_t *size)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i->suffix && devpath) {
|
if (i->suffix && devpath) {
|
||||||
bootpath = qemu_malloc(strlen(devpath) + strlen(i->suffix) + 1);
|
size_t bootpathlen = strlen(devpath) + strlen(i->suffix) + 1;
|
||||||
sprintf(bootpath, "%s%s", devpath, i->suffix);
|
|
||||||
|
bootpath = qemu_malloc(bootpathlen);
|
||||||
|
snprintf(bootpath, bootpathlen, "%s%s", devpath, i->suffix);
|
||||||
qemu_free(devpath);
|
qemu_free(devpath);
|
||||||
} else if (devpath) {
|
} else if (devpath) {
|
||||||
bootpath = devpath;
|
bootpath = devpath;
|
||||||
|
|
Loading…
Reference in New Issue