Fix OpenBSD linker warning

qemu-option.o(.text+0x20f8): In function `qemu_opts_from_qdict_1':
/src/qemu/qemu-option.c:813: warning: strcpy() is almost always misused, please use strlcpy()

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2010-03-18 20:48:19 +00:00
parent 43dc2a645e
commit d35215f808
1 changed files with 2 additions and 1 deletions

View File

@ -810,7 +810,8 @@ static void qemu_opts_from_qdict_1(const char *key, QObject *obj, void *opaque)
value = buf;
break;
case QTYPE_QBOOL:
strcpy(buf, qbool_get_int(qobject_to_qbool(obj)) ? "on" : "off");
pstrcpy(buf, sizeof(buf),
qbool_get_int(qobject_to_qbool(obj)) ? "on" : "off");
value = buf;
break;
default: