Replace sprintf() by safer snprintf() to format debug dump
silencing -Wdeprecated-declarations produced by Apple clang
17.0.0.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 hw/net/eepro100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index aaa3eb60f8ab..44eff5fd3ad8 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -369,7 +369,7 @@ static const char *nic_dump(const uint8_t * buf, unsigned 
size)
         size = 16;
     }
     while (size-- > 0) {
-        p += sprintf(p, " %02x", *buf++);
+        p += snprintf(p, sizeof(dump) - (p - dump), " %02x", *buf++);
     }
     return dump;
 }
-- 
2.55.0


Reply via email to