free: remove redundant boundary check
The strtol_or_err() already check argument is not larger than LONG_MAX. This commit also removes clang warning. free.c:262:55: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if (args.repeat_counter < 1 || args.repeat_counter > ULONG_MAX/2) ~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
90c0590b4c
commit
a3544b00f8
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 < 1 || args.repeat_counter > ULONG_MAX/2)
|
||||
if (args.repeat_counter < 1)
|
||||
error(EXIT_FAILURE, ERANGE,
|
||||
_("failed to parse count argument: '%s'"), optarg);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user