gbranden pushed a commit to branch master
in repository groff.

commit dcf9bfbef5db9ab0286ac0cda2105616397f91d1
Author: Alejandro Colomar <[email protected]>
AuthorDate: Sat Mar 16 13:35:06 2024 +0100

    [indxbib]: Remove dead code.
    
    * src/utils/indxbib/indxbib.cpp (check_integer_arg): Remove dead code.
      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" <[email protected]>
    Cc: Dave Kemper <[email protected]>
    Cc: "James K. Lowden" <[email protected]>
    Cc: Colin Watson <[email protected]>
    Cc: Werner LEMBERG <[email protected]>
    Cc: James Clark <[email protected]>
    Signed-off-by: Alejandro Colomar <[email protected]>
---
 ChangeLog                     | 6 ++++++
 src/utils/indxbib/indxbib.cpp | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 5af96da39..a0a821e13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-03-16  Alejandro Colomar <[email protected]>
+
+       * src/utils/indxbib/indxbib.cpp (check_integer_arg): Remove dead
+       code.  The tests (LONG_MAX > INT_MAX && n > INT_MAX) and (n >
+       INT_MAX) are equivalent.
+
 2024-03-16  Alejandro Colomar <[email protected]>
 
        * src/utils/indxbib/indxbib.cpp (check_integer_arg): Clear
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);

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to