2023-03-27 14:31:22

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v1 1/1] 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 <[email protected]>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index fbe320b5e89f..40f560959b16 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -3642,7 +3642,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;

--
2.40.0.1.gaa8946217a0b


2023-03-28 01:42:04

by Sergey Senozhatsky

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] lib/vsprintf: Use isodigit() for the octal number check

On (23/03/27 17:27), Andy Shevchenko wrote:
>
> Use isodigit() to test the octal number instead of homegrown approach.
>
> Signed-off-by: Andy Shevchenko <[email protected]>

FWIW
Reviewed-by: Sergey Senozhatsky <[email protected]>

2023-03-28 08:46:08

by Petr Mladek

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] lib/vsprintf: Use isodigit() for the octal number check

On Mon 2023-03-27 17:27:21, Andy Shevchenko wrote:
> Use isodigit() to test the octal number instead of homegrown approach.
>
> Signed-off-by: Andy Shevchenko <[email protected]>

Reviewed-by: Petr Mladek <[email protected]>

Best Regards,
Petr

2023-04-03 10:41:57

by Petr Mladek

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] lib/vsprintf: Use isodigit() for the octal number check

On Mon 2023-03-27 17:27:21, Andy Shevchenko wrote:
> Use isodigit() to test the octal number instead of homegrown approach.
>
> Signed-off-by: Andy Shevchenko <[email protected]>

JFYI, the patch has been committed into printk/linux.git,
branch for-6.4.

Best Regards,
Petr