Audit dirname(1)

Be stricter about the number of arguments passed to it.
This commit is contained in:
FRIGN 2015-02-28 19:50:12 +01:00
parent cb610b2c7b
commit e45297a320
3 changed files with 5 additions and 5 deletions

2
README
View File

@ -24,7 +24,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
=* cron non-posix none =* cron non-posix none
#* cut yes none #* cut yes none
=* date yes -u =* date yes -u
=* dirname yes none =*| dirname yes none
=* du yes none =* du yes none
=* echo yes none =* echo yes none
=* env yes none =* env yes none

View File

@ -1,4 +1,4 @@
.Dd January 23, 2015 .Dd February 28, 2015
.Dt DIRNAME 1 .Dt DIRNAME 1
.Os sbase .Os sbase
.Sh NAME .Sh NAME
@ -9,9 +9,9 @@
.Ar path .Ar path
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
prints writes
.Ar path .Ar path
with its final path component removed. with its final path component removed to stdout.
.Sh SEE ALSO .Sh SEE ALSO
.Xr basename 1 , .Xr basename 1 ,
.Xr dirname 3 .Xr dirname 3

View File

@ -18,7 +18,7 @@ main(int argc, char *argv[])
usage(); usage();
} ARGEND; } ARGEND;
if (argc < 1) if (argc != 1)
usage(); usage();
puts(dirname(argv[0])); puts(dirname(argv[0]));