diff --git a/README b/README index 9727f85..ad9586f 100644 --- 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 index 9744309..e65d8e9 100644 --- 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 index 11e9f02..63ea7bd 100644 --- 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; }