asc2log: Correct usec overflow handling
This commit fixes these lines (1614188635.1000000) can1 4A8##28001E9A318ACC0 R to become this (1614188636.000000) can1 4A8##28001E9A318ACC0 Rpull/300/head
parent
5116452e6d
commit
9c2de072a0
|
|
@ -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++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue