[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 08/10] [indxbib]: Remove dead code
From: |
Alejandro Colomar |
Subject: |
[PATCH v4 08/10] [indxbib]: Remove dead code |
Date: |
Sat, 16 Mar 2024 12:54:54 +0100 |
The tests (LONG_MAX > INT_MAX && n > INT_MAX) and (n > INT_MAX) are
equivalent.
Fixes: d7b36a45fc3f ("[indxbib]: Mitigate Savannah #65452.")
Link: <https://savannah.gnu.org/bugs/?65452>
Link: <https://lists.gnu.org/archive/html/groff/2024-03/msg00065.html>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Dave Kemper <saint.snit@gmail.com>
Cc: "James K. Lowden" <jklowden@schemamania.org>
Cc: Colin Watson <cjwatson@debian.org>
Cc: Werner LEMBERG <wl@gnu.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
src/utils/indxbib/indxbib.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index 6253e4782..68d5756e2 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -346,7 +346,7 @@ static void check_integer_arg(char opt, const char *arg,
int min, int *res)
fatal("argument to -%1 not an integer", opt);
if (n < min)
fatal("argument to -%1 must not be less than %2", opt, min);
- if ((LONG_MAX > INT_MAX) && (n > INT_MAX))
+ if (n > INT_MAX)
fatal("argument to -%1 must be between %2 and %3", arg, min, INT_MAX);
if (*ptr != '\0')
fatal("junk after integer argument to -%1", opt);
--
2.43.0
signature.asc
Description: PGP signature
- [PATCH v4 00/10] strtol(3)-related fixes, (continued)
- [PATCH v4 00/10] strtol(3)-related fixes, Alejandro Colomar, 2024/03/16
- [PATCH v4 01/10] [libgroff]: Remove redundant checks., Alejandro Colomar, 2024/03/16
- [PATCH v4 02/10] [libgroff]: Remove dead code, Alejandro Colomar, 2024/03/16
- [PATCH v4 03/10] src/: Remove redundant checks after strtol(3)., Alejandro Colomar, 2024/03/16
- [PATCH v4 04/10] [grolbp]: Remove bogus (and redundant) check, Alejandro Colomar, 2024/03/16
- [PATCH v4 05/10] src/: ceil_prime(): Add function to get the lowest prime not less than n, Alejandro Colomar, 2024/03/16
- [PATCH v4 06/10] [indxbib]: Don't else after [[noreturn]], Alejandro Colomar, 2024/03/16
- [PATCH v4 07/10] [indxbib]: Clear errno before calling strtol(3), Alejandro Colomar, 2024/03/16
- [PATCH v4 10/10] [grolbp]: Fix range check after strtol(3), Alejandro Colomar, 2024/03/16
- Re: [PATCH v4 10/10] [grolbp]: Fix range check after strtol(3), Alejandro Colomar, 2024/03/16
- [PATCH v4 08/10] [indxbib]: Remove dead code,
Alejandro Colomar <=
- [PATCH v4 09/10] [indxbib]: Collapse related tests, Alejandro Colomar, 2024/03/16
- [PATCH v5 00/10] strtol(3)-related fixes, Alejandro Colomar, 2024/03/16
- [PATCH v5 01/10] [libgroff]: Remove redundant checks., Alejandro Colomar, 2024/03/16
- [PATCH v5 02/10] [libgroff]: Remove dead code, Alejandro Colomar, 2024/03/16
- [PATCH v5 03/10] src/: Remove redundant checks after strtol(3)., Alejandro Colomar, 2024/03/16
- [PATCH v5 04/10] [grolbp]: Remove bogus (and redundant) check, Alejandro Colomar, 2024/03/16
- [PATCH v5 05/10] src/: ceil_prime(): Add function to get the lowest prime not less than n, Alejandro Colomar, 2024/03/16
- [PATCH v5 06/10] [indxbib]: Don't else after [[noreturn]], Alejandro Colomar, 2024/03/16
- [PATCH v5 07/10] [indxbib]: Clear errno before calling strtol(3), Alejandro Colomar, 2024/03/16
- [PATCH v5 08/10] [indxbib]: Remove dead code, Alejandro Colomar, 2024/03/16