tv_usec is only valid in the range [0, 999999].
If the file contains garbage data replace interpret it as "0" instead.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
addr_string = inet_ntop(AF_INET, &(ut->ut_addr_v6), buffer, sizeof(buffer));
tv.tv_sec = ut->ut_tv.tv_sec;
- tv.tv_usec = ut->ut_tv.tv_usec;
+ tv.tv_usec = ut->ut_tv.tv_usec < (int32_t) USEC_PER_SEC ? ut->ut_tv.tv_usec : 0;
if (strtimeval_iso(&tv, ISO_TIMESTAMP_COMMA_GT, time_string,
sizeof(time_string)) != 0)
last 9 is expected to disappear in conversion
[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,123456+00:00]
[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,999999+00:00]
-[0] [00000] [ts/0] [nonvalid] [foo ] [zero ] [0.0.0.0 ] [2013-08-28T12:00:00,12345678+00:00]
+[0] [00000] [ts/0] [nonvalid] [foo ] [zero ] [0.0.0.0 ] [2013-08-28T12:00:00,000000+00:00]