From 9c2de072a076236410f6c5a112bd7b9075a9e77d Mon Sep 17 00:00:00 2001 From: Simon Tegelid Date: Fri, 16 Apr 2021 14:20:19 +0200 Subject: [PATCH] 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 --- asc2log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asc2log.c b/asc2log.c index b14e7db..71be7f8 100644 --- a/asc2log.c +++ b/asc2log.c @@ -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++; }