summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-04-18 14:01:51 +0200
committerAlejandro Colomar <alx@kernel.org>2024-04-18 14:01:52 +0200
commitfb780435921038f6264fcbc74fe424e7d65b7de3 (patch)
tree71be087bfe31f3bc868af4cb4a117953f20e795f
parenta29abf9bb7d4c783da9a766e8d10feae7d8f5862 (diff)
downloadliba2i-fb780435921038f6264fcbc74fe424e7d65b7de3.tar.gz
include/a2i/strtoi.h: a2i_strtou_noneg(): Use 1 instead of INTMAX_MAX
Both work, since we just use this call as a boolean check that the string was negative. Using 1 makes the line shorter, so we can merge two lines, and avoid using braces. Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--include/a2i/strtoi.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/a2i/strtoi.h b/include/a2i/strtoi.h
index ce6f8f0..aa5d5b4 100644
--- a/include/a2i/strtoi.h
+++ b/include/a2i/strtoi.h
@@ -115,11 +115,8 @@ a2i_strtou_noneg(const char *s,
if (status == NULL)
status = &st;
- if (a2i_strtoi(s, endp, base, 0, INTMAX_MAX, status) == 0
- && *status == ERANGE)
- {
+ if (a2i_strtoi(s, endp, base, 0, 1, status) == 0 && *status == ERANGE)
return min;
- }
return a2i_strtou(s, endp, base, min, max, status);
}