]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-telnet.c
s/u_short/u_int16_t/ for KAME-origin source codes
[tcpdump] / print-telnet.c
index 505369c56f487b3876b29e54d9aa810ca434f108..cdce8398c2009f86e14dac72f717c77030867bd6 100644 (file)
 #include "config.h"
 #endif
 
-#include <sys/cdefs.h>
-#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 <sys/param.h>
@@ -65,7 +63,6 @@ __RCSID("$NetBSD: print-telnet.c,v 1.2 1999/10/11 12:40:12 sjg Exp $");
 #include <netinet/ip.h>
 #include <netinet/ip_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #define TELCMDS
 #define TELOPTS
@@ -130,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++;