eepro100: Replace sprintf by snprintf
authorStefan Weil <weil@mail.berlios.de>
Sat, 19 Sep 2009 10:29:59 +0000 (12:29 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 26 Sep 2009 21:48:17 +0000 (23:48 +0200)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
hw/eepro100.c

index 89987d7..f1a9310 100644 (file)
@@ -537,12 +537,12 @@ static char *regname(uint32_t addr)
     if (addr < PCI_IO_SIZE) {
         const char *r = reg[addr / 4];
         if (r != 0) {
-            sprintf(buf, "%s+%u", r, addr % 4);
+            snprintf(buf, sizeof(buf), "%s+%u", r, addr % 4);
         } else {
-            sprintf(buf, "0x%02x", addr);
+            snprintf(buf, sizeof(buf), "0x%02x", addr);
         }
     } else {
-        sprintf(buf, "??? 0x%08x", addr);
+        snprintf(buf, sizeof(buf), "??? 0x%08x", addr);
     }
     return buf;
 }