]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Create an informative error message when detecting a wrong line format.
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Fri, 25 Jul 2008 06:32:20 +0000 (06:32 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Fri, 25 Jul 2008 06:32:20 +0000 (06:32 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@813 030b6a49-0b11-0410-94ab-b0dab22257f2

can-utils/canplayer.c

index e8a1356c208a4ebc3a427a3fe8a47a8f5aeca79b..074f6a9a6143a387706254716de4749edeeb47db 100644 (file)
@@ -382,8 +382,10 @@ int main(int argc, char **argv)
                eof = 0;
 
                if (sscanf(buf, "(%ld.%ld) %s %s", &log_tv.tv_sec, &log_tv.tv_usec,
-                          device, ascframe) != 4)
+                          device, ascframe) != 4) {
+                       fprintf(stderr, "incorrect line format in logfile\n");
                        return 1;
+               }
 
                if (use_timestamps) { /* throttle sending due to logfile timestamps */
 
@@ -452,8 +454,10 @@ int main(int argc, char **argv)
                                }
 
                                if (sscanf(buf, "(%ld.%ld) %s %s", &log_tv.tv_sec, &log_tv.tv_usec,
-                                          device, ascframe) != 4)
+                                          device, ascframe) != 4) {
+                                       fprintf(stderr, "incorrect line format in logfile\n");
                                        return 1;
+                               }
 
                                if (use_timestamps) {
                                        gettimeofday(&today_tv, NULL);