X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c9d84d15c5c4dc8eca7594101fe5026080ed641e..dff10c7f70d539c431a1eba9ab5e076d8b0f5c8e:/print-atalk.c diff --git a/print-atalk.c b/print-atalk.c index 0a5a3f67..f4df1482 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -23,7 +23,11 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.50 1999-10-30 05:11:10 itojun 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 +#include "config.h" #endif #include @@ -534,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); } @@ -542,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); @@ -565,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));