Fix OpenBSD linker warning

helper.o(.text+0x11e0): In function `listflags':
/src/qemu/target-i386/helper.c:661: warning: sprintf() is often misused, please use snprintf()

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2010-02-23 22:01:36 +00:00
parent 161717d2cb
commit d354899c82

View File

@ -657,8 +657,9 @@ static void listflags(char *buf, int bufsize, uint32_t fbits,
else
nc = snprintf(q, bufsize, "%s[%d]", q == buf ? "" : " ", bit);
if (bufsize <= nc) {
if (b)
sprintf(b, "...");
if (b) {
memcpy(b, "...", sizeof("..."));
}
return;
}
q += nc;