X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/5a796b82bd7e85d479c6ccc6eb0a6ddf321e840d..0023eaa78f123676bfa9c5fba72ea4b8a59aaa70:/print-rx.c?ds=sidebyside diff --git a/print-rx.c b/print-rx.c index 26b51c19..3641a4c7 100644 --- a/print-rx.c +++ b/print-rx.c @@ -35,9 +35,7 @@ * Ken Hornstein */ -#ifdef HAVE_CONFIG_H #include -#endif #include #include @@ -794,12 +792,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; \