X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/069d6e270a6cbbe5170a6afa7c7a5bebfc4f299b..6e67dba79fc8142ba1c55c82bd3551286126186c:/print-telnet.c diff --git a/print-telnet.c b/print-telnet.c index df2147e6..cdce8398 100644 --- a/print-telnet.c +++ b/print-telnet.c @@ -49,13 +49,9 @@ #include "config.h" #endif -#ifdef HAVE_SYS_CDEFS_H -#include -#endif -#if 0 #ifndef lint -__RCSID("$NetBSD: print-telnet.c,v 1.2 1999/10/11 12:40:12 sjg Exp $"); -#endif +static const char rcsid[] = + "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.6 2000-01-17 06:24:26 itojun Exp $"; #endif #include @@ -131,15 +127,16 @@ telnet_print(register const u_char *sp, u_int length) x = *sp++; /* option */ length--; if (x >= 0 && x < NTELOPTS) { - (void)sprintf(tnet, "%s %s", - telcmds[i], telopts[x]); + (void)snprintf(tnet, sizeof(tnet), + "%s %s", telcmds[i], telopts[x]); } else { - (void)sprintf(tnet, "%s %#x", - telcmds[i], x); + (void)snprintf(tnet, sizeof(tnet), + "%s %#x", telcmds[i], x); } break; default: - (void)strcpy(tnet, telcmds[i]); + (void)snprintf(tnet, sizeof(tnet), "%s", + telcmds[i]); } if (c == SB) { c = *sp++;