From: Marco Bettini Date: Fri, 26 Nov 2021 13:45:47 +0000 (+0100) Subject: lib: str_parse_intmax() - Replace signed expression with UNSIGNED_MINUS() X-Git-Tag: 2.3.18~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f7254a6af51d0bdda38acaa67bb56bef1fdf5d7;p=thirdparty%2Fdovecot%2Fcore.git lib: str_parse_intmax() - Replace signed expression with UNSIGNED_MINUS() Found by code analysis tool --- diff --git a/src/lib/strnum.c b/src/lib/strnum.c index fe1bdbca63..4b3da4a5f9 100644 --- a/src/lib/strnum.c +++ b/src/lib/strnum.c @@ -334,7 +334,7 @@ str_parse_intmax(const char *str, intmax_t *num_r, const char **endp_r) } else { if (l > UINTMAX_MAX - (UINTMAX_MAX + INTMAX_MIN)) return -1; - *num_r = (intmax_t)-l; + *num_r = (intmax_t) UNSIGNED_MINUS(l); } return 0; }