Create an informative error message when detecting a wrong line format.

pull/7/head
Oliver Hartkopp 2008-07-25 06:32:20 +00:00
parent 15ce202e60
commit 6c0ca36ab2
1 changed files with 6 additions and 2 deletions

View 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);