From: Andy Shevchenko Date: Mon, 27 Mar 2023 14:27:21 +0000 (+0300) Subject: lib/vsprintf: Use isodigit() for the octal number check X-Git-Tag: microblaze-v6.6~662^2~1 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=48e1a66fecb4e8b64cf2a0a8978c048990181d94;p=linux-2.6-microblaze.git lib/vsprintf: Use isodigit() for the octal number check Use isodigit() to test the octal number instead of homegrown approach. Signed-off-by: Andy Shevchenko Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230327142721.48378-1-andriy.shevchenko@linux.intel.com --- diff --git a/lib/vsprintf.c b/lib/vsprintf.c index be71a03c936a..426418253fd4 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -3621,7 +3621,7 @@ int vsscanf(const char *buf, const char *fmt, va_list args) if (!digit || (base == 16 && !isxdigit(digit)) || (base == 10 && !isdigit(digit)) - || (base == 8 && (!isdigit(digit) || digit > '7')) + || (base == 8 && !isodigit(digit)) || (base == 0 && !isdigit(digit))) break;