gbranden pushed a commit to branch master
in repository groff.

commit 655ecf086142a676252a385c1c7a8be838ae9f3a
Author: Alejandro Colomar <[email protected]>
AuthorDate: Sat Mar 16 13:34:57 2024 +0100

    [indxbib]: Don't `else` after [[noreturn]].
    
    * src/utils/indxbib/indxbib.cpp (check_integer_arg): Don't `else` after
      [[noreturn]].
    
    Fixes: d7b36a45fc3f ("[indxbib]: Mitigate Savannah #65452.")
    Link: <https://savannah.gnu.org/bugs/?65452>
    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                     |  5 +++++
 src/utils/indxbib/indxbib.cpp | 20 ++++++++------------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 110e4e8c2..9336aa317 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-03-16  Alejandro Colomar <[email protected]>
+
+       * src/utils/indxbib/indxbib.cpp (check_integer_arg): Don't
+       `else` after [[noreturn]].
+
 2024-03-16  Alejandro Colomar <[email protected]>
 
        [libgroff,libbib,indxbib]: Add, use `ceil_prime()`.
diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index b15bd8187..c5996c279 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -340,20 +340,16 @@ static void check_integer_arg(char opt, const char *arg, 
int min, int *res)
   char *ptr;
   long n = strtol(arg, &ptr, 10);
   if (ERANGE == errno)
-    fatal("argument to -%1 must be between %2 and %3", arg, min,
-         INT_MAX);
-  else if (ptr == arg)
+    fatal("argument to -%1 must be between %2 and %3", arg, min, INT_MAX);
+  if (ptr == arg)
     fatal("argument to -%1 not an integer", opt);
-  else if (n < min)
+  if (n < min)
     fatal("argument to -%1 must not be less than %2", opt, min);
-  else {
-    if ((LONG_MAX > INT_MAX) && (n > INT_MAX))
-      fatal("argument to -%1 must be between %2 and %3", arg, min,
-           INT_MAX);
-    else if (*ptr != '\0')
-      fatal("junk after integer argument to -%1", opt);
-    *res = static_cast<int>(n);
-  }
+  if ((LONG_MAX > INT_MAX) && (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);
+  *res = static_cast<int>(n);
 }
 
 static char *get_cwd()

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

Reply via email to