commit a20a9350db43e8e00761ae0ca4f5a2fe752c31ea
parent 1b7155943196afcde33b4d3ce235fa2786c02d9a
Author: FRIGN <dev@frign.de>
Date: Wed, 18 Mar 2015 00:14:56 +0100
Audit uuencode(1)
Style cleanup, Manpage refactoring.
Diffstat:
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/README b/README
@@ -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
@@ -1,4 +1,4 @@
-.Dd February 13, 2015
+.Dd March 18, 2015
.Dt UUENCODE 1
.Os sbase
.Sh NAME
@@ -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
@@ -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;
}
@@ -110,7 +111,7 @@ main(int argc, char *argv[])
usage();
} ARGEND;
- if (argc == 0 || argc > 2)
+ if (!argc || argc > 2)
usage();
if (argc == 1) {
@@ -127,5 +128,6 @@ main(int argc, char *argv[])
uuencode(fp, argv[1], argv[0]);
fclose(fp);
}
+
return 0;
}