diff options
author | itojun <itojun> | 2000-01-17 06:24:23 +0000 |
---|---|---|
committer | itojun <itojun> | 2000-01-17 06:24:23 +0000 |
commit | dff10c7f70d539c431a1eba9ab5e076d8b0f5c8e (patch) | |
tree | 29fbd05a7fa3afbeba9b422f86f9995c166d2eaa /print-atalk.c | |
parent | 92d3fd1b47a8c041297a3dfa655f0d548012f61c (diff) | |
download | tcpdump-dff10c7f70d539c431a1eba9ab5e076d8b0f5c8e.tar.gz |
s/sprintf/snprintf/.
there seem to be couple of unsafe use of strcat and strcpy - we should
bring in strl{cat,cpy}.
Diffstat (limited to 'print-atalk.c')
-rw-r--r-- | print-atalk.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/print-atalk.c b/print-atalk.c index 5134ebc1..f4df1482 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.51 1999-11-21 09:36:48 fenner Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.52 2000-01-17 06:24:24 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -538,7 +538,8 @@ ataddr_string(u_short atnet, u_char athost) if (tp2->addr == i) { tp->addr = (atnet << 8) | athost; tp->nxt = newhnamemem(); - (void)sprintf(nambuf, "%s.%d", tp2->name, athost); + (void)snprintf(nambuf, sizeof(nambuf), "%s.%d", + tp2->name, athost); tp->name = savestr(nambuf); return (tp->name); } @@ -546,10 +547,11 @@ ataddr_string(u_short atnet, u_char athost) tp->addr = (atnet << 8) | athost; tp->nxt = newhnamemem(); if (athost != 255) - (void)sprintf(nambuf, "%d.%d.%d", + (void)snprintf(nambuf, sizeof(nambuf), "%d.%d.%d", atnet >> 8, atnet & 0xff, athost); else - (void)sprintf(nambuf, "%d.%d", atnet >> 8, atnet & 0xff); + (void)snprintf(nambuf, sizeof(nambuf), "%d.%d", atnet >> 8, + atnet & 0xff); tp->name = savestr(nambuf); return (tp->name); @@ -569,7 +571,7 @@ ddpskt_string(register int skt) static char buf[8]; if (nflag) { - (void)sprintf(buf, "%d", skt); + (void)snprintf(buf, sizeof(buf), "%d", skt); return (buf); } return (tok2str(skt2str, "%d", skt)); |