]> Git Repo - qemu.git/commitdiff
Fix OpenBSD linker warning
authorBlue Swirl <[email protected]>
Tue, 23 Feb 2010 22:01:36 +0000 (22:01 +0000)
committerBlue Swirl <[email protected]>
Tue, 23 Feb 2010 22:01:36 +0000 (22:01 +0000)
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 <[email protected]>
target-i386/helper.c

index 57e6f7c80657096b929363a33d92177b529768dc..080d2b8c7d35551ee8041d9e9ad8ab720c0db6cf 100644 (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;
This page took 0.025473 seconds and 4 git commands to generate.