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
pull/300/head
Simon Tegelid 2021-04-16 14:20:19 +02:00 committed by Oliver Hartkopp
parent 5116452e6d
commit 9c2de072a0
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ void calc_tv(struct timeval *tv, struct timeval *read_tv,
tv->tv_usec += read_tv->tv_usec;
}
if (tv->tv_usec > 1000000) {
if (tv->tv_usec >= 1000000) {
tv->tv_usec -= 1000000;
tv->tv_sec++;
}