mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
Create an informative error message when detecting a wrong line format.
This commit is contained in:
+6
-2
@@ -382,8 +382,10 @@ int main(int argc, char **argv)
|
|||||||
eof = 0;
|
eof = 0;
|
||||||
|
|
||||||
if (sscanf(buf, "(%ld.%ld) %s %s", &log_tv.tv_sec, &log_tv.tv_usec,
|
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;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (use_timestamps) { /* throttle sending due to logfile timestamps */
|
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,
|
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;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (use_timestamps) {
|
if (use_timestamps) {
|
||||||
gettimeofday(&today_tv, NULL);
|
gettimeofday(&today_tv, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user