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 <andriy.shevchenko@linux.intel.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20230327142721.48378-1-andriy.shevchenko@linux.intel.com
This commit is contained in:
Andy Shevchenko 2023-03-27 17:27:21 +03:00 committed by Petr Mladek
parent 0c705be960
commit 48e1a66fec

View File

@ -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;