diff --git a/hw2/src/par.c b/hw2/src/par.c index 06026f2..5b9cd2a 100644 --- a/hw2/src/par.c +++ b/hw2/src/par.c @@ -235,7 +235,7 @@ static void setdefaults( start = *inlines; for (end = start; *end; ++end); for (line = inlines + 1; *line; ++line) { - for (p2 = *line; *p2; ++p2) + for (p2 = *line; *p2; ++p2); for (p1 = end; p1 > start && p2 > *line && p1[-1] == p2[-1]; --p1, --p2); @@ -297,6 +297,7 @@ int original_main(int argc, const char * const *argv) for (;;) { for (;;) { c = getchar(); + if (c == EOF) goto parcleanup; if (c != '\n') break; putchar(c); }