From a3544b00f8589c67eb8c41c4fbf3af97025235e6 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 26 Feb 2012 12:26:59 +0100 Subject: [PATCH] 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 --- free.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/free.c b/free.c index 54825ab0..5a618d32 100644 --- a/free.c +++ b/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; -- 2.40.0