diff --git a/usr.bin/ctags/print.c b/usr.bin/ctags/print.c index b2c313a556b7..bebdeb1bc90b 100644 --- a/usr.bin/ctags/print.c +++ b/usr.bin/ctags/print.c @@ -59,7 +59,7 @@ getline() saveftell = ftell(inf); (void)fseek(inf, lineftell, L_SET); if (xflag) - for (cp = lbuf; GETC(!=, '\n'); *cp++ = c) + for (cp = lbuf; GETC(!=, EOF) && c != '\n'; *cp++ = c) continue; /* * do all processing here, so we don't step through the