]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-rx.c
Makefile.in: don't remove configure and config.h.in in make distclean.
[tcpdump] / print-rx.c
index 4f0195282ff6340db97a2f2bd23ef74225e02d28..dbef71c05be4846dfc2f0c2b09e6a9979cae368d 100644 (file)
@@ -40,7 +40,6 @@
 #endif
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include "netdissect-stdinc.h"
 
@@ -500,7 +499,7 @@ static int  rx_cache_find(netdissect_options *, const struct rx_header *,
 
 static void fs_print(netdissect_options *, const u_char *, u_int);
 static void fs_reply_print(netdissect_options *, const u_char *, u_int, uint32_t);
-static void acl_print(netdissect_options *, u_char *, u_char *);
+static void acl_print(netdissect_options *, u_char *, const u_char *);
 static void cb_print(netdissect_options *, const u_char *, u_int);
 static void cb_reply_print(netdissect_options *, const u_char *, u_int, uint32_t);
 static void prot_print(netdissect_options *, const u_char *, u_int);
@@ -795,12 +794,12 @@ rx_cache_find(netdissect_options *ndo, const struct rx_header *rxh,
                        ND_PRINT(" %" PRIu64, _i); \
                }
 
-#define DATEOUT() { time_t _t; struct tm *tm; char str[256]; \
+#define DATEOUT() { time_t _t; char str[256]; \
                        _t = (time_t) GET_BE_S_4(bp); \
                        bp += sizeof(int32_t); \
-                       tm = localtime(&_t); \
-                       strftime(str, 256, "%Y/%m/%d %H:%M:%S", tm); \
-                       ND_PRINT(" %s", str); \
+                       ND_PRINT(" %s", \
+                           nd_format_time(str, sizeof(str), \
+                             "%Y/%m/%d %H:%M:%S", localtime(&_t))); \
                }
 
 #define STOREATTROUT() { uint32_t mask, _i; \
@@ -1141,11 +1140,12 @@ trunc:
  * representing a logical OR of all the ACL permission bits
  */
 
+#define XSTRINGIFY(x) #x
 #define NUMSTRINGIFY(x)        XSTRINGIFY(x)
 
 static void
 acl_print(netdissect_options *ndo,
-          u_char *s, u_char *end)
+          u_char *s, const u_char *end)
 {
        int pos, neg, acl;
        int n, i;