Link: <https://savannah.gnu.org/bugs/?65452> Cc: "G. Branden Robinson" <[email protected]> Cc: Dave Kemper <[email protected]> Cc: "James K. Lowden" <[email protected]> Signed-off-by: Alejandro Colomar <[email protected]> --- src/utils/indxbib/indxbib.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
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()
--
2.43.0
signature.asc
Description: PGP signature
