Fix a segfault which occurs when it gets an empty input line.

Closes PR bin/1153

Reviewed by:	smpatel
Submitted by:	Matthew C. Mead (mmead@Glock.COM)
This commit is contained in:
Sujal Patel 1996-04-22 18:37:22 +00:00
parent 91e2481238
commit 003aaef883
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15344

View File

@ -172,7 +172,6 @@ fmt(fi)
*cp++ = c;
c = getc(fi);
}
*cp = '\0';
/*
* Toss anything remaining on the input line.
@ -180,6 +179,14 @@ fmt(fi)
while (c != '\n' && c != EOF)
c = getc(fi);
if (cp != NULL) {
*cp = '\0';
} else {
putchar('\n');
c = getc(fi);
continue;
}
/*
* Expand tabs on the way to canonb.
*/