Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 {
- 2 char *line = NULL;
- 3 size_t len = 0;
- 4 unsigned int lineno = 0;
- 5
- 6 error_message_count = 0;
- 7 while (! feof_unlocked (fp))
- 8 {
- 9 ssize_t n = getline (&line, &len, fp);
- 10 if (n <= 0)
- 11 /* End of file or error. */
- 12 break;
- 13 ++lineno;
- 14
- 15 /* Process the line. */
- 16 ***
- 17
- 18 if (Detect error in line)
- 19 error_at_line (0, errval, fileno, lineno,
- 20 "some error text %s", some_variable);
- 21 }
- 22 if (error_message_count != 0)
- 23 error (EXIT_FAILURE, 0, "%u errors found", error_message_count);
- 24 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement