From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD9C9C7EE43 for ; Sat, 10 Jun 2023 20:41:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.546624.853648 (Exim 4.92) (envelope-from ) id 1q85Ok-0002RS-EK; Sat, 10 Jun 2023 20:41:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 546624.853648; Sat, 10 Jun 2023 20:41:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q85Ok-0002RL-BY; Sat, 10 Jun 2023 20:41:22 +0000 Received: by outflank-mailman (input) for mailman id 546624; Sat, 10 Jun 2023 20:41:22 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q85Oj-0001R8-Vt for xen-devel@lists.xenproject.org; Sat, 10 Jun 2023 20:41:21 +0000 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 27b34702-07cf-11ee-b232-6b7b168915f2; Sat, 10 Jun 2023 22:41:21 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1EB553200406; Sat, 10 Jun 2023 16:41:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 10 Jun 2023 16:41:19 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Jun 2023 16:41:16 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 27b34702-07cf-11ee-b232-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1686429677; x=1686516077; bh=zmp6AIFl9e 0+GK3wpF6apHM7zkfOYrIi/BxUW3DBWhg=; b=XntlKjsZ5vDs46MOdTHeyZvitC BCBFcNS/FcjDeM4XTmVsTCGqKa9sKUIJGJiUpAMewiO6Plsxy3NVeFGBq8NGsvyU GmoJkr+GPhlevaRfzm4zjiJ08mvreC9A/De2b9rgogK/ImxMUZ+tJHDfol/yS0JY oyJcRP4oaJZsBnoYCeuKke1Vs53z97j0PgY+7WY0pIvTokA4oXghbVBdBd2H7jqA SnO5O6nFE6IxWxE82FkqwETAUDKyE7S9s2W+43S2zcLL7M/sYgX/0j4iH7Dn2AJD WYgthgHRztCWMpOsWFENQrdViXckE0dd6dTtn2+Yyzlgw/HGxm0feESXHAlQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1686429677; x= 1686516077; bh=zmp6AIFl9e0+GK3wpF6apHM7zkfOYrIi/BxUW3DBWhg=; b=t 6bzJo1vxBIOrwPu0ry6yxCkK73ctnRvQQkcD14iOjwkykEWG1hVsXieiKE6k5NMo MvwbMUrFgySmNmuX99+3TZrYpJsSFglclvPh7wO7WVvxg69vgP3qdKR93ihj/9jB jLfH17ITpjrmIWan6f75YlQiAh8RePrGRDAtizZ+dIt0mZy+/jdNG4xoEyfTsM3D WlbGRbmJ+mTteuu4hoWczjdPd0U/JTe7vR4PcmqZHg+pKIe+Q824PocdJtNuIXvq THe/4dB4TnLuN5+5t/XxTtXSXXsB7rk2uxKJVjqObJYiZyAqQn96tu8km8ynSHYI Cg/oDgONfxx1lW5NjptVg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedutddgudehhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffvghm ihcuofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinh hgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeekveekveegudffgffgleekudeu keetlefgveelhfehuedtfedvgfeklefhtefgfeenucffohhmrghinhepkhgvrhhnvghlrd horhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep uggvmhhisehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Feedback-ID: iac594737:Fastmail From: Demi Marie Obenour To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Lee Jones , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes Cc: Demi Marie Obenour , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Christoph Hellwig Subject: [PATCH v3 3/4] vsscanf(): do not skip spaces Date: Sat, 10 Jun 2023 16:40:43 -0400 Message-Id: <20230610204044.3653-4-demi@invisiblethingslab.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230610204044.3653-1-demi@invisiblethingslab.com> References: <20230610204044.3653-1-demi@invisiblethingslab.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Passing spaces before e.g. an integer is usually not intended. This was suggested by Christoph in https://lore.kernel.org/lkml/ZIQrohcizoj4bZWx@infradead.org/. Suggested-by: Christoph Hellwig Signed-off-by: Demi Marie Obenour --- lib/vsprintf.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 9e53355c35b1d6260631868228ede1d178fe3325..665f6197f8313d653f67d7886b12c43942e058dd 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -3551,8 +3551,6 @@ int vsscanf(const char *buf, const char *fmt, va_list args) char *s = (char *)va_arg(args, char *); if (field_width == -1) field_width = SHRT_MAX; - /* first, skip leading white space in buffer */ - str = skip_spaces(str); /* now copy until next white space */ while (*str && !isspace(*str) && field_width--) @@ -3639,11 +3637,7 @@ int vsscanf(const char *buf, const char *fmt, va_list args) return num; } - /* have some sort of integer conversion. - * first, skip white space in buffer. - */ - str = skip_spaces(str); - + /* have some sort of integer conversion. */ digit = *str; if (is_sign && digit == '-') { if (field_width == 1) -- Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab