]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ntp.c
Use tok2str() and tok2strary().
[tcpdump] / print-ntp.c
index 886a45fa1b9323d572d6821e8b2e5b73c71acc6a..8e795cbc88152849ebe1a76ff11a9aa60ae0e7b0 100644 (file)
@@ -25,7 +25,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.28 2000-07-01 03:39:07 assar Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.32 2001-08-20 15:36:57 fenner Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,12 +36,7 @@ static const char rcsid[] =
 #include <sys/time.h>
 #include <sys/socket.h>
 
-struct mbuf;
-struct rtentry;
-#include <net/if.h>
-
 #include <netinet/in.h>
-#include <netinet/if_ether.h>
 
 #include <ctype.h>
 #include <stdio.h>
@@ -66,7 +61,6 @@ ntp_print(register const u_char *cp, u_int length)
 {
        register const struct ntpdata *bp;
        int mode, version, leapind;
-       static char rclock[5];
 
        bp = (struct ntpdata *)cp;
        /* Note funny sized packets */
@@ -161,9 +155,7 @@ ntp_print(register const u_char *cp, u_int length)
                break;
 
        case PRIM_REF:
-               strncpy(rclock, (char *)&(bp->refid), 4);
-               rclock[4] = '\0';
-               fputs(rclock, stdout);
+               fn_printn((char *)&(bp->refid), 4, NULL);
                break;
 
        case INFO_QUERY: