mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-06 14:59:53 +02:00
candump: Avoid ragged output of timestamp values when printing differential
timestamps (commandline option -td). Idea & original patch by Uwe Bonnes. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
@@ -716,7 +716,7 @@ int main(int argc, char **argv)
|
||||
diff.tv_sec--, diff.tv_usec += 1000000;
|
||||
if (diff.tv_sec < 0)
|
||||
diff.tv_sec = diff.tv_usec = 0;
|
||||
printf("(%ld.%06ld) ", diff.tv_sec, diff.tv_usec);
|
||||
printf("(%03ld.%06ld) ", diff.tv_sec, diff.tv_usec);
|
||||
|
||||
if (timestamp == 'd')
|
||||
last_tv = tv; /* update for delta calculation */
|
||||
|
||||
Reference in New Issue
Block a user