From: Marek Küthe Date: Sat, 15 Feb 2025 21:35:41 +0000 (+0000) Subject: Remove redundant code X-Git-Tag: v0.96~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F526%2Fhead;p=thirdparty%2Fmtr.git Remove redundant code As @yvs2014 noted in https://github.com/traviscross/mtr/issues/523#issuecomment-2660970185, it is unnecessary to check whether an int is larger than the maximum int value. An int cannot be greater than the maximum int value. --- diff --git a/ui/utils.c b/ui/utils.c index 45dd47a..8e8c6d8 100644 --- a/ui/utils.c +++ b/ui/utils.c @@ -80,7 +80,7 @@ int strtoint_or_err( if (str != NULL && *str != '\0') { errno = 0; num = strtol(str, &end, 0); - if (errno == 0 && str != end && end != NULL && *end == '\0' && num < INT_MAX) { + if (errno == 0 && str != end && end != NULL && *end == '\0') { return num; } } @@ -99,7 +99,7 @@ unsigned long strtoulong_or_err( if (str != NULL && *str != '\0') { errno = 0; num = strtoul(str, &end, 0); - if (errno == 0 && str != end && end != NULL && *end == '\0' && num < UINT32_MAX) { + if (errno == 0 && str != end && end != NULL && *end == '\0') { return num; } }