From c6d71297bcc6a9410d3cff46322f3c17f334b99e Mon Sep 17 00:00:00 2001 From: Huangbin Zhan Date: Thu, 2 Jul 2026 09:56:48 -0400 Subject: [PATCH] BUG/MINOR: tools: fix invalid character detection in strl2ic() ASCII characters with a value smaller than '0' were not properly detected as invalid characters, leading to incorrect behavior. The strl2irc() and strl2llrc() functions are not impacted because this situation is detected by their overflow checks. Fixes Github issue #3357. --- src/tools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools.c b/src/tools.c index 6c3dce7c9..5b15905a8 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2584,8 +2584,8 @@ long long int read_int64(const char **s, const char *end) */ int strl2ic(const char *s, int len) { - int i = 0; - int j, k; + int i = 0, k; + unsigned int j; if (len > 0) { if (*s != '-') { -- 2.47.3