From 64427a889b424c55e6917e5110e66ba004610fa9 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 22 Mar 2013 00:26:12 -0500 Subject: uuencode/decode tests and tweaks from Erich Plondke. --- toys/pending/uudecode.c | 1 + toys/pending/uuencode.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'toys/pending') diff --git a/toys/pending/uudecode.c b/toys/pending/uudecode.c index 71774ea2..41d9acf3 100644 --- a/toys/pending/uudecode.c +++ b/toys/pending/uudecode.c @@ -171,4 +171,5 @@ void uudecode_main(void) ofd = xcreate(out_filename,O_WRONLY|O_CREAT|O_TRUNC,mode); free(line); decoder(ifd,ofd); + if (TOYBOX_CLEANUP) close(ofd); } diff --git a/toys/pending/uuencode.c b/toys/pending/uuencode.c index d6cc5ad2..277cefac 100644 --- a/toys/pending/uuencode.c +++ b/toys/pending/uuencode.c @@ -57,7 +57,7 @@ static void uuencode_b64(int fd, const char *name) xprintf("begin-base64 744 %s\n",name); do { len = xread(fd,inbuf,48); - uuencode_b64_line(outbuf,inbuf,len); + if (len > 0) uuencode_b64_line(outbuf,inbuf,len); } while (len > 0); xprintf("====\n"); } -- cgit v1.2.3