sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit e00fe1f9bf0d40e2aefd501cb2f69d7a07538696
parent 39b9aab25ad10804109c9442f12ef62a6819bb43
Author: FRIGN <dev@frign.de>
Date:   Sat, 28 Feb 2015 20:10:25 +0100

Audit sleep(1)

1) Be strict about argc
2) Use "unsigned" instead of "unsigned int"

Diffstat:
MREADME | 2+-
Msleep.c | 5+++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/README b/README @@ -64,7 +64,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support, = sha1sum non-posix none = sha256sum non-posix none = sha512sum non-posix none -=* sleep yes none +=*| sleep yes none sort no -m, -o, -d, -f, -i =* split yes none =* sponge non-posix none diff --git a/sleep.c b/sleep.c @@ -12,18 +12,19 @@ usage(void) int main(int argc, char *argv[]) { - unsigned int seconds; + unsigned seconds; ARGBEGIN { default: usage(); } ARGEND; - if (argc < 1) + if (argc != 1) usage(); seconds = estrtonum(argv[0], 0, UINT_MAX); while ((seconds = sleep(seconds)) > 0) ; + return 0; }