asc2log: Correct usec overflow handling

This commit fixes these lines
(1614188635.1000000) can1 4A8##28001E9A318ACC0 R
to become this
(1614188636.000000) can1 4A8##28001E9A318ACC0 R
This commit is contained in:
Simon Tegelid
2021-04-16 14:30:50 +02:00
committed by Oliver Hartkopp
parent 5116452e6d
commit 9c2de072a0
+1 -1
View File
@@ -119,7 +119,7 @@ void calc_tv(struct timeval *tv, struct timeval *read_tv,
tv->tv_usec += read_tv->tv_usec; tv->tv_usec += read_tv->tv_usec;
} }
if (tv->tv_usec > 1000000) { if (tv->tv_usec >= 1000000) {
tv->tv_usec -= 1000000; tv->tv_usec -= 1000000;
tv->tv_sec++; tv->tv_sec++;
} }