lib/vsprintf: Use isodigit() for the octal number check
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 27 Mar 2023 14:27:21 +0000 (17:27 +0300)
committerPetr Mladek <pmladek@suse.com>
Mon, 3 Apr 2023 08:51:25 +0000 (10:51 +0200)
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
lib/vsprintf.c

index be71a03..4264182 100644 (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;