Replace 0x80000000 mask test on tv_sec by a test on tv_sec
negative in ts_date_hmsfrac_print() and ts_unix_print().
Replace the error message by "[timestamp < 1970-01-01 00:00:00 UTC]"
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;
}
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;
}