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:
parent
161717d2cb
commit
d354899c82
@ -657,8 +657,9 @@ static void listflags(char *buf, int bufsize, uint32_t fbits,
|
|||||||
else
|
else
|
||||||
nc = snprintf(q, bufsize, "%s[%d]", q == buf ? "" : " ", bit);
|
nc = snprintf(q, bufsize, "%s[%d]", q == buf ? "" : " ", bit);
|
||||||
if (bufsize <= nc) {
|
if (bufsize <= nc) {
|
||||||
if (b)
|
if (b) {
|
||||||
sprintf(b, "...");
|
memcpy(b, "...", sizeof("..."));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
q += nc;
|
q += nc;
|
||||||
|
Loading…
Reference in New Issue
Block a user