[hackers] [sbase] Audit uuencode(1) || FRIGN

From: <git_AT_suckless.org>
Date: Thu, 19 Mar 2015 11:13:24 +0100 (CET)

commit 2ec48d0b5e81ef2885ddfa599504a10e1df8eeb8
Author: FRIGN <dev_AT_frign.de>
Date: Wed Mar 18 00:14:56 2015 +0100

    Audit uuencode(1)
    
    Style cleanup, Manpage refactoring.

diff --git a/README b/README
index 9727f85..ad9586f 100644
--- a/README
+++ b/README
_AT_@ -85,7 +85,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
 =*| uniq yes none
 =*| unlink yes none
 =*| uudecode yes none
-=* uuencode yes none
+=*| uuencode yes none
 #* wc yes none
 = xargs no -I, -L, -p, -s, -t, -x
 =*| yes non-posix none
diff --git a/uuencode.1 b/uuencode.1
index 9744309..e65d8e9 100644
--- a/uuencode.1
+++ b/uuencode.1
_AT_@ -1,4 +1,4 @@
-.Dd February 13, 2015
+.Dd March 18, 2015
 .Dt UUENCODE 1
 .Os sbase
 .Sh NAME
_AT_@ -13,11 +13,16 @@
 .Nm
 reads
 .Ar file
-(or by default, the standard input) and writes an encoded version
-to the standard output. The encoding uses only printing ASCII characters and
+and writes an encoded version to stdout.
+The encoding uses only printing ASCII characters and
 includes the mode of the file and the operand
 .Ar name
 for use by uudecode.
+If no
+.Ar name
+is given,
+.Nm
+reads from stdin.
 .Sh OPTIONS
 .Bl -tag -width Ds
 .It Fl m
diff --git a/uuencode.c b/uuencode.c
index 11e9f02..63ea7bd 100644
--- a/uuencode.c
+++ b/uuencode.c
_AT_@ -18,6 +18,7 @@ b64e(unsigned char b[2])
         o = (o << 8) | b64et[p & 0x3f]; p >>= 6;
         o = (o << 8) | b64et[p & 0x3f]; p >>= 6;
         o = (o << 8) | b64et[p & 0x3f];
+
         return o;
 }
 
_AT_@ -110,7 +111,7 @@ main(int argc, char *argv[])
                 usage();
         } ARGEND;
 
- if (argc == 0 || argc > 2)
+ if (!argc || argc > 2)
                 usage();
 
         if (argc == 1) {
_AT_@ -127,5 +128,6 @@ main(int argc, char *argv[])
                         uuencode(fp, argv[1], argv[0]);
                 fclose(fp);
         }
+
         return 0;
 }
Received on Thu Mar 19 2015 - 11:13:24 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 19 2015 - 11:24:38 CET