diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-15 22:34:07 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-15 22:34:07 +0000 |
commit | 25b0b1ce1c2c494d1330e6d32572ce6b806d8f10 (patch) | |
tree | bb9dd9c3c817e54ba1bd51b298e62a43fc76a13c /bin | |
parent | a1d30f6274565f7c1a66c195d68d90798aac89b8 (diff) |
sprintf -> snprintf paranoia
Diffstat (limited to 'bin')
-rw-r--r-- | bin/pax/cache.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/pax/cache.c b/bin/pax/cache.c index b64be94b3af..639f702c777 100644 --- a/bin/pax/cache.c +++ b/bin/pax/cache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cache.c,v 1.3 1996/06/23 14:20:30 deraadt Exp $ */ +/* $OpenBSD: cache.c,v 1.4 1996/09/15 22:34:06 millert Exp $ */ /* $NetBSD: cache.c,v 1.4 1995/03/21 09:07:10 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: cache.c,v 1.3 1996/06/23 14:20:30 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: cache.c,v 1.4 1996/09/15 22:34:06 millert Exp $"; #endif #endif /* not lint */ @@ -247,9 +247,10 @@ name_uid(uid, frc) ptr->uid = uid; ptr->valid = INVALID; # ifdef NET2_STAT - (void)sprintf(ptr->name, "%u", uid); + (void)snprintf(ptr->name, sizeof(ptr->name), "%u", uid); # else - (void)sprintf(ptr->name, "%lu", (unsigned long)uid); + (void)snprintf(ptr->name, sizeof(ptr->name), "%lu", + (unsigned long)uid); # endif if (frc == 0) return(""); @@ -324,9 +325,10 @@ name_gid(gid, frc) ptr->gid = gid; ptr->valid = INVALID; # ifdef NET2_STAT - (void)sprintf(ptr->name, "%u", gid); + (void)snprintf(ptr->name, sizeof(ptr->name), "%u", gid); # else - (void)sprintf(ptr->name, "%lu", (unsigned long)gid); + (void)snprintf(ptr->name, sizeof(ptr->name), "%lu", + (unsigned long)gid); # endif if (frc == 0) return(""); |