Skip to contentSkip to conversation

eepro100: Replace sprintf by snprintf

PATCH New Stefan Weil 1 participant 1 message Sep 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eepro100: Replace sprintf by snprintf

This patch is a step to synchronize my maintainer version of eepro100.c (git://repo.or.cz/qemu/ar7.git) with the version integrated in QEMU.

---
 hw/eepro100.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
hw/eepro100.c +3 -3
index 89987d7..f1a9310 100644
@@ -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;
 }
Signature · 1 line
1.5.6.5