From d354899c8279146f3e154b9ba1f7461abb7f5279 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Tue, 23 Feb 2010 22:01:36 +0000 Subject: 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 --- target-i386/helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'target-i386') diff --git a/target-i386/helper.c b/target-i386/helper.c index 57e6f7c..080d2b8 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -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; -- cgit v1.1