From patchwork Sat Jun 10 20:40:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Demi Marie Obenour X-Patchwork-Id: 106014 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1731771vqr; Sat, 10 Jun 2023 13:53:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66Hr+bGjct+bUwgyw7OE5dZ8xPcW8EoUPRwzso9co1ZAI+EpMRQ89uBmzWZFuk976H/S6W X-Received: by 2002:a05:6a20:8e0a:b0:10e:2fd5:5106 with SMTP id y10-20020a056a208e0a00b0010e2fd55106mr6080735pzj.35.1686430390470; Sat, 10 Jun 2023 13:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686430390; cv=none; d=google.com; s=arc-20160816; b=P9ixvQxtXz6yLK+bvG+cjGtbzsTZEl9ibZ0hfNtNd/I34al2O+WVD1FYqTzr9VV+IE kGGk5hBFZ/NSNwbwpOHzLVdIFY2lCDRWminhpbEzuThqjbNGGmP5/UQAuyXaTlQ5FGvq iXCDPVEYh/2ZjFBCZgeM0Eu/lLApedSP80vdhK2yaWrfWx9gP0zrzRI3W25fWs0RIr1X Or02PPVLHGte6dTfyDOzxhR0bGjtHIlbAXADCRIdRlYF/1P+QYW3zbYRRhBEVgIMnL7H INCUwAyTCD54epZGmOcy4m8i73Z9kMX/zGLN3y0/+kD6H1f3deGdRTujQTQdqtf/BK3f csYQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=zmp6AIFl9e0+GK3wpF6apHM7zkfOYrIi/BxUW3DBWhg=; b=G2ALs9YeK2SYuLnmB5skbMBee590NXgayUg1AkrI2vj9mK6UU4scH8ppq0eLtHlEtv xOuVKVSaboyQ0nDVMj8Ahebjr8e2WMiTzKN77nEGZHI3IHQoY59u94KMPU7R8WN8oFVQ 6Zylld0raUKiPQbZb595RoeoJxNn2Ub+ht2WaHk98XTpuoNE+KgGtDHAPp/MvJ53AQ1v 7bBbsR+gNt6SuhDyXIWubC5cNtghJ9k2+h3Ue4Ovfu6vgDOKSmEGmngSQuh3i2/S/9qA hzRMUBCjxkLKBRVdJ5HiHRENpPSDejPfHwZVaLjkeigbJgcvr0El153ZWpHfNE/hedrm JtAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b=XntlKjsZ; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=t6bzJo1v; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 85-20020a630258000000b0053f25281d15si883958pgc.537.2023.06.10.13.52.58; Sat, 10 Jun 2023 13:53:10 -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=@invisiblethingslab.com header.s=fm1 header.b=XntlKjsZ; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=t6bzJo1v; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229483AbjFJUlf (ORCPT + 99 others); Sat, 10 Jun 2023 16:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231748AbjFJUlc (ORCPT ); Sat, 10 Jun 2023 16:41:32 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49A733C18; Sat, 10 Jun 2023 13:41:20 -0700 (PDT) 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 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 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Jun 2023 16:41:16 -0400 (EDT) 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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768350433368862188?= X-GMAIL-MSGID: =?utf-8?q?1768350433368862188?= 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)