From f0df23d778ae5b85745de0e48729b039b5b3f69a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 8 Jul 2012 18:09:54 -0700 Subject: Convert remaining sprintf calls to snprintf Signed-off-by: Alan Coopersmith Reviewed-by: Mark Kettenis --- prtype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'prtype.c') diff --git a/prtype.c b/prtype.c index 1fb917d..d16647c 100644 --- a/prtype.c +++ b/prtype.c @@ -99,7 +99,7 @@ printrep(unsigned short c) } else { /* very large number -- print as 0xffff - 4 digit hex */ - sprintf(pr, "0x%04x", c); + snprintf(pr, sizeof(pr), "0x%04x", c); } return (pr); } @@ -1073,7 +1073,7 @@ DumpHexBuffer(const unsigned char *buf, long n) column = 27 + SizeofLeader(); for (i = 0; i < n; i++) { /* get the hex representations */ - sprintf(h, "%02x", (0xff & buf[i])); + snprintf(h, sizeof(h), "%02x", (0xff & buf[i])); /* check if these characters will fit on this line */ if ((column + strlen(h) + 1) > MAXline) { -- cgit v1.2.1