Audit sleep(1)
1) Be strict about argc 2) Use "unsigned" instead of "unsigned int"
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user