fix length after '\' getline string termination

This commit is contained in:
Hiltjo Posthuma
2016-02-25 21:42:36 +01:00
committed by sin
parent 58257275f0
commit e8eeb19fcd
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 (!len || bufb[len - 1] != '\n')
if (bufb[len - 1] != '\n')
eprintf("no newline found, aborting\n");
bufb[len - 1] = '\0';
bufb[--len] = '\0';
/* check for last line */
if ((i = DEC(*p)) <= 0)