]> rtime.felk.cvut.cz Git - sojka/can-utils.git/blobdiff - candump.c
slcanpty: fix wrong usage of nbytes variable
[sojka/can-utils.git] / candump.c
index 2981b481b7e7ae2271de68d79a39a4411e7fa956..bf3e8bb5d18614a322f43d3e6f9dfdf6ee6a0b30 100644 (file)
--- a/candump.c
+++ b/candump.c
@@ -1,7 +1,3 @@
-/*
- *  $Id$
- */
-
 /*
  * candump.c
  *
@@ -686,7 +682,7 @@ int main(int argc, char **argv)
 
                                if (log) {
                                        /* log CAN frame with absolute timestamp & device */
-                                       fprintf(logfile, "(%ld.%06ld) ", tv.tv_sec, tv.tv_usec);
+                                       fprintf(logfile, "(%010ld.%06ld) ", tv.tv_sec, tv.tv_usec);
                                        fprintf(logfile, "%*s ", max_devname_len, devname[idx]);
                                        /* without seperator as logfile use-case is parsing */
                                        fprint_canframe(logfile, &frame, "\n", 0, maxdlen);
@@ -694,7 +690,7 @@ int main(int argc, char **argv)
 
                                if (logfrmt) {
                                        /* print CAN frame in log file style to stdout */
-                                       printf("(%ld.%06ld) ", tv.tv_sec, tv.tv_usec);
+                                       printf("(%010ld.%06ld) ", tv.tv_sec, tv.tv_usec);
                                        printf("%*s ", max_devname_len, devname[idx]);
                                        fprint_canframe(stdout, &frame, "\n", 0, maxdlen);
                                        goto out_fflush; /* no other output to stdout */
@@ -713,7 +709,7 @@ int main(int argc, char **argv)
                                switch (timestamp) {
 
                                case 'a': /* absolute with timestamp */
-                                       printf("(%ld.%06ld) ", tv.tv_sec, tv.tv_usec);
+                                       printf("(%010ld.%06ld) ", tv.tv_sec, tv.tv_usec);
                                        break;
 
                                case 'A': /* absolute with date */