From fb780435921038f6264fcbc74fe424e7d65b7de3 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 18 Apr 2024 14:01:51 +0200 Subject: 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 --- include/a2i/strtoi.h | 5 +---- 1 file changed, 1 insertion(+), 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); } -- cgit v1.2.3