Create an informative error message when detecting a wrong line format.
parent
15ce202e60
commit
6c0ca36ab2
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue