From 9ea7bc457e848ba1700e8911f2a327714e4dfcf1 Mon Sep 17 00:00:00 2001 From: hanzhijian Date: Sat, 1 Aug 2026 14:35:32 +0800 Subject: [PATCH] libs/libc: support explicit bases up to 36 The strto* interfaces document explicit bases in the range 2 through 36, and lib_isbasedigit() already supports alphabetic digits through base 36. However, lib_checkbase() rejects every explicit base above 26 with EINVAL. Raise the validation limit to 36 so the conversion interfaces accept the full documented range while continuing to reject base 37 and above. Signed-off-by: hanzhijian --- libs/libc/stdlib/lib_checkbase.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/stdlib/lib_checkbase.c b/libs/libc/stdlib/lib_checkbase.c index 3c322b67ca4..7ea29dac655 100644 --- a/libs/libc/stdlib/lib_checkbase.c +++ b/libs/libc/stdlib/lib_checkbase.c @@ -104,7 +104,7 @@ int lib_checkbase(int base, FAR const char **pptr) /* Check for incorrect bases. */ - else if (base < 2 || base > 26) + else if (base < 2 || base > 36) { return -1; /* Means incorrect base */ }