uudecode: fix no newline before EOF
This commit is contained in:
parent
ddeb4c0e35
commit
bb79b5c7eb
|
@ -170,10 +170,10 @@ uudecode(FILE *fp, FILE *outfp)
|
||||||
while ((len = getline(&bufb, &n, fp)) != -1) {
|
while ((len = getline(&bufb, &n, fp)) != -1) {
|
||||||
p = bufb;
|
p = bufb;
|
||||||
/* trim newlines */
|
/* trim newlines */
|
||||||
if (len && bufb[len - 1] != '\n')
|
if (!len || bufb[len - 1] != '\n')
|
||||||
bufb[len - 1] = '\0';
|
|
||||||
else
|
|
||||||
eprintf("no newline found, aborting\n");
|
eprintf("no newline found, aborting\n");
|
||||||
|
bufb[len - 1] = '\0';
|
||||||
|
|
||||||
/* check for last line */
|
/* check for last line */
|
||||||
if ((i = DEC(*p)) <= 0)
|
if ((i = DEC(*p)) <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user