Check for 0 repeat count and tests in free
free checks for -c 0 now too. testsuite has new checks for the checks.
This commit is contained in:
2
free.c
2
free.c
@@ -259,7 +259,7 @@ int main(int argc, char **argv)
|
||||
flags |= FREE_REPEATCOUNT;
|
||||
args.repeat_counter = strtol_or_err(optarg,
|
||||
_("failed to parse count argument"));
|
||||
if (args.repeat_counter > ULONG_MAX/2)
|
||||
if (args.repeat_counter < 1 || args.repeat_counter > ULONG_MAX/2)
|
||||
error(EXIT_FAILURE, ERANGE,
|
||||
_("failed to parse count argument: '%s'"), optarg);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user