diff options
Diffstat (limited to 'Parser/pgenmain.c')
-rw-r--r-- | Parser/pgenmain.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c index 017a4f9..0f055d6 100644 --- a/Parser/pgenmain.c +++ b/Parser/pgenmain.c @@ -96,10 +96,11 @@ getgrammar(char *filename) fprintf(stderr, "Parsing error %d, line %d.\n", err.error, err.lineno); if (err.text != NULL) { - size_t i; + size_t len; + int i; fprintf(stderr, "%s", err.text); - i = strlen(err.text); - if (i == 0 || err.text[i-1] != '\n') + len = strlen(err.text); + if (len == 0 || err.text[len-1] != '\n') fprintf(stderr, "\n"); for (i = 0; i < err.offset; i++) { if (err.text[i] == '\t') |