Message ID | 20230327142721.48378-1-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1558862vqo; Mon, 27 Mar 2023 07:35:46 -0700 (PDT) X-Google-Smtp-Source: AK7set8T9cPulG9cWkVyY0RmeB2H1QD4ONbsyQQ1LoO7MXFWoC6Bq/ucm658B01wAKxsG4wty+mQ X-Received: by 2002:a05:6402:a53:b0:4bf:b2b1:84d8 with SMTP id bt19-20020a0564020a5300b004bfb2b184d8mr20029769edb.19.1679927745957; Mon, 27 Mar 2023 07:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679927745; cv=none; d=google.com; s=arc-20160816; b=V44deyIR+xoQT825t7Ih5CyTYaZ+qNdVKlSXYduF7xeQ4YtYBk6cNeSi9NMur9YKO5 SMotKw4/PhK0cy1UjpKjosxryaESXavZKm6pwMR96YU09Aqsce3DvXhIJcFBkNAG3e66 W1CVAam68/mnRqnZr+bX5VaoauFtrOH5eyZt1FttTbvxSWdC+P0eJUpEXDrGefQ7A0Pp 89M/FgM88jexoB2zs26z7PFSKMEoBzw1aSH4yNcBOd1W//Fr/FNQBA9wZREtyn40GhlU Xt5PWseThpyoHdHUL0Ls5E+ohxHy+O1Ko6C6C6xbmx8nJbKdjN7zcwp8/P9etxGbSd4A hGKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=E3JWq4PQNKTO2zqEveFryAi9kgNDjjoqnr4zMGnpAFo=; b=nWJjcoy4CzHykE37UiKjnKZHsLM6SOGXXlJ3Hl3pwd7gKuZyRCw9p+HuwfPtSJtGaC xrQkjNAt7Zw7ptBdh7IB/Qb63OA+LZdhJl8zUy2tKhBnOzwD3dGl7DjSgXQ1Yz4o4fbD 2e0FVmlRd9tssGKlRRJiLyK0STNM1aoYyYTHn+TXYO+U3DWOjgK93GBUIPjjBq1qDNE8 lFcctJkr5w8yTpv0iDlgaiWAMaErjnfvPGBZwSN8rP4Ugr9R5sH5NBambo75ENm5FoMm B1WF+5NBCg5cl9DUTLR1TheiF21kGToKXAoQqvHbgxquATxuPHoJyCoIkyrUZ6za3BlP 2tig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YicTcMlL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020aa7cb90000000b00501db82b63csi14578940edt.172.2023.03.27.07.35.12; Mon, 27 Mar 2023 07:35:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YicTcMlL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233187AbjC0O2g (ORCPT <rfc822;makky5685@gmail.com> + 99 others); Mon, 27 Mar 2023 10:28:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232617AbjC0O2P (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Mar 2023 10:28:15 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79710659B for <linux-kernel@vger.kernel.org>; Mon, 27 Mar 2023 07:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679927257; x=1711463257; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bwHaYJuF6V1NJzur1wTeCyoLa0ib0Nh/wjM0jlUNCOo=; b=YicTcMlLw2rwrSH/GukA+0spntmptxHLG6jkf6wubgZBIyyIraomfCmX Z9dNeD8tctvlSelbEZSdIPKbM+ZoqOMus1qyvle+yqBBFFEJUX+pIYbWq f1fSY13fGx/8+3FVYk0wb6yQfpIfUu6NVv0lEV2A0MWl7fF4PyWZCvF0g yA/tfpYuDfF17EAmne8gvcsYsbLse9gqXMezRb3+iK8MZpI7fGA+pTBJN tMmwVhcsSIM0/7AejIKeMv3b3ubV5sxhlQqhxTK6Jij5xgUBqzC/Oh7iF ME+sc4g/R+lh3SA7gzrjQrjqzmeLpNF6PtITFZal9Bns9z18R2otiG8rG Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="320676727" X-IronPort-AV: E=Sophos;i="5.98,294,1673942400"; d="scan'208";a="320676727" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2023 07:27:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="676981809" X-IronPort-AV: E=Sophos;i="5.98,294,1673942400"; d="scan'208";a="676981809" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 27 Mar 2023 07:27:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6753479C; Mon, 27 Mar 2023 17:27:35 +0300 (EEST) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Petr Mladek <pmladek@suse.com>, linux-kernel@vger.kernel.org Cc: Steven Rostedt <rostedt@goodmis.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Rasmus Villemoes <linux@rasmusvillemoes.dk> Subject: [PATCH v1 1/1] lib/vsprintf: Use isodigit() for the octal number check Date: Mon, 27 Mar 2023 17:27:21 +0300 Message-Id: <20230327142721.48378-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761531915721777825?= X-GMAIL-MSGID: =?utf-8?q?1761531915721777825?= |
Series |
[v1,1/1] lib/vsprintf: Use isodigit() for the octal number check
|
|
Commit Message
Andy Shevchenko
March 27, 2023, 2:27 p.m. UTC
Use isodigit() to test the octal number instead of homegrown approach.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
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 <andriy.shevchenko@linux.intel.com> FWIW Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
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 <andriy.shevchenko@linux.intel.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Best Regards, Petr
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 <andriy.shevchenko@linux.intel.com> JFYI, the patch has been committed into printk/linux.git, branch for-6.4. Best Regards, Petr
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;