2 * A Pedantic Check of Text Input/Output File Syntax
4 * (c) 2005 Martin Mares <mj@ucw.cz>
17 while ((c = getchar()) >= 0)
22 printf("Line %d: Trailing spaces\n", line);
23 if (line == 1 && !pos)
24 printf("Line %d: Leading empty line\n", line);
28 printf("Line %d: Consecutive empty lines\n", line);
38 printf("Line %d: Leading spaces\n", line);
40 printf("Line %d: Consecutive spaces\n", line);
46 if (c < ' ' || c >= 0x7f)
47 printf("Line %d: Invalid character 0x%02x\n", line, c);
53 printf("Line %d: Incomplete line at the end of file\n", line);
55 printf("Line %d: Trailing empty line\n", line-1);
56 printf("Found %d lines, the longest has %d chars\n", line-1, maxlen);