Commit e848f5aa298158243bde1c657821a2cdcfc1f88d

Duncan Overbruck 2024-03-05T17:02:32

strtonum: Do not abort on EINVAL from strtoi() With musl libc strtoimax(".", ...) returns EINVAL. Closes: !28 Signed-off-by: Guillem Jover <guillem@hadrons.org>

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/strtonum.c b/src/strtonum.c
index 8d6faa1..f85f741 100644
--- a/src/strtonum.c
+++ b/src/strtonum.c
@@ -58,6 +58,7 @@ strtonum(const char *nptr, long long minval, long long maxval,
 		return rv;
 	case ECANCELED:
 	case ENOTSUP:
+	case EINVAL:
 		goto out;
 	case ERANGE:
 		if (*eptr)