From 5ee7fd1e1245ab88a701f466797da26f38c7977b Mon Sep 17 00:00:00 2001 From: hartkopp Date: Fri, 25 Jul 2008 06:32:20 +0000 Subject: [PATCH] Create an informative error message when detecting a wrong line format. git-svn-id: svn://svn.berlios.de//socketcan/trunk@813 030b6a49-0b11-0410-94ab-b0dab22257f2 --- can-utils/canplayer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/can-utils/canplayer.c b/can-utils/canplayer.c index e8a1356..074f6a9 100644 --- a/can-utils/canplayer.c +++ b/can-utils/canplayer.c @@ -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); -- 2.39.2