Revert "fix length after '\' getline string termination"

Caused a regression in sed, revert until we investigate further.
This commit is contained in:
sin
2016-03-01 15:23:23 +00:00
parent fa18379a05
commit ea0d16e928
5 changed files with 8 additions and 8 deletions

View File

@@ -169,9 +169,9 @@ uudecode(FILE *fp, FILE *outfp)
while ((len = getline(&bufb, &n, fp)) > 0) {
p = bufb;
/* trim newlines */
if (bufb[len - 1] != '\n')
if (!len || bufb[len - 1] != '\n')
eprintf("no newline found, aborting\n");
bufb[--len] = '\0';
bufb[len - 1] = '\0';
/* check for last line */
if ((i = DEC(*p)) <= 0)