]> The Tcpdump Group git mirrors - tcpdump/blobdiff - util-print.c
Update the "Error converting time" tests for packet times
[tcpdump] / util-print.c
index 7a6bd09955a26c49d91d4dbec988783962aae16d..ec4cf743ca71630402b355d3e4958f513d78249b 100644 (file)
@@ -249,8 +249,8 @@ ts_date_hmsfrac_print(netdissect_options *ndo, const struct timeval *tv,
        char timebuf[32];
        const char *timestr;
 
-       if ((unsigned)tv->tv_sec & 0x80000000) {
-               ND_PRINT("[Error converting time]");
+       if (tv->tv_sec < 0) {
+               ND_PRINT("[timestamp < 1970-01-01 00:00:00 UTC]");
                return;
        }
 
@@ -277,8 +277,8 @@ ts_date_hmsfrac_print(netdissect_options *ndo, const struct timeval *tv,
 static void
 ts_unix_print(netdissect_options *ndo, const struct timeval *tv)
 {
-       if ((unsigned)tv->tv_sec & 0x80000000) {
-               ND_PRINT("[Error converting time]");
+       if (tv->tv_sec < 0) {
+               ND_PRINT("[timestamp < 1970-01-01 00:00:00 UTC]");
                return;
        }