summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-04-05 14:34:32 +0000
committerderaadt <deraadt@openbsd.org>2003-04-05 14:34:32 +0000
commit19ee32ccd4b93a285a4243d5e007be1e518ef341 (patch)
tree570188092deca3bea65160f6b4be45187d566e21
parentsprintf->snprintf (diff)
downloadwireguard-openbsd-19ee32ccd4b93a285a4243d5e007be1e518ef341.tar.xz
wireguard-openbsd-19ee32ccd4b93a285a4243d5e007be1e518ef341.zip
snprintf
-rw-r--r--usr.bin/gprof/printgprof.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/gprof/printgprof.c b/usr.bin/gprof/printgprof.c
index 2c98f31bc3d..66b64b1d395 100644
--- a/usr.bin/gprof/printgprof.c
+++ b/usr.bin/gprof/printgprof.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printgprof.c,v 1.6 2002/03/25 16:30:55 danh Exp $ */
+/* $OpenBSD: printgprof.c,v 1.7 2003/04/05 14:34:32 deraadt Exp $ */
/* $NetBSD: printgprof.c,v 1.5 1995/04/19 07:16:21 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)printgprof.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: printgprof.c,v 1.6 2002/03/25 16:30:55 danh Exp $";
+static char rcsid[] = "$OpenBSD: printgprof.c,v 1.7 2003/04/05 14:34:32 deraadt Exp $";
#endif
#endif /* not lint */
@@ -177,7 +177,7 @@ gprofline( np )
{
char kirkbuffer[ BUFSIZ ];
- sprintf( kirkbuffer , "[%d]" , np -> index );
+ snprintf(kirkbuffer, sizeof kirkbuffer, "[%d]" , np -> index );
printf( "%-6.6s %5.1f %7.2f %11.2f" , kirkbuffer ,
100 * ( np -> propself + np -> propchild ) / printtime ,
np -> propself / hz , np -> propchild / hz );
@@ -472,7 +472,7 @@ printcycle( cyclep )
{
char kirkbuffer[ BUFSIZ ];
- sprintf(kirkbuffer , "[%d]" , cyclep->index);
+ snprintf(kirkbuffer, sizeof kirkbuffer, "[%d]" , cyclep->index);
printf("%-6.6s %5.1f %7.2f %11.2f %7ld", kirkbuffer,
100 * (cyclep->propself + cyclep->propchild) / printtime,
cyclep->propself / hz, cyclep->propchild / hz, cyclep->npropcall);
@@ -705,15 +705,16 @@ printindex()
for ( j = i; j < todo ; j += index ) {
nlp = namesortnlp[ j ];
if ( nlp -> printflag ) {
- sprintf( peterbuffer , "[%d]" , nlp -> index );
+ snprintf(peterbuffer, sizeof peterbuffer, "[%d]" , nlp -> index );
} else {
- sprintf( peterbuffer , "(%d)" , nlp -> index );
+ snprintf(peterbuffer, sizeof peterbuffer, "(%d)" , nlp -> index );
}
if ( j < nnames ) {
printf( "%6.6s %-19.19s" , peterbuffer , nlp -> name );
} else {
printf( "%6.6s " , peterbuffer );
- sprintf( peterbuffer , "<cycle %d>" , nlp -> cycleno );
+ snprintf(peterbuffer, sizeof peterbuffer, "<cycle %d>"
+ , nlp -> cycleno );
printf( "%-19.19s" , peterbuffer );
}
}