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 X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBD2BC43600 for ; Wed, 19 May 2021 00:51:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C336B6135C for ; Wed, 19 May 2021 00:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233020AbhESAwY (ORCPT ); Tue, 18 May 2021 20:52:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352867AbhESAu5 (ORCPT ); Tue, 18 May 2021 20:50:57 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94DF2C061763; Tue, 18 May 2021 17:49:38 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1ljAOT-00G4FU-CE; Wed, 19 May 2021 00:49:01 +0000 From: Al Viro To: Linus Torvalds Cc: Jia He , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Jonathan Corbet , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "Eric W . Biederman" , "Darrick J. Wong" , "Peter Zijlstra (Intel)" , Ira Weiny , Eric Biggers , "Ahmed S. Darwish" , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-s390 , linux-fsdevel Subject: [PATCH 01/14] d_path: "\0" is {0,0}, not {0} Date: Wed, 19 May 2021 00:48:48 +0000 Message-Id: <20210519004901.3829541-1-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Single-element array consisting of one NUL is spelled ""... Signed-off-by: Al Viro --- fs/d_path.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/d_path.c b/fs/d_path.c index 270d62133996..01df5dfa1f88 100644 --- a/fs/d_path.c +++ b/fs/d_path.c @@ -184,7 +184,7 @@ char *__d_path(const struct path *path, char *res = buf + buflen; int error; - prepend(&res, &buflen, "\0", 1); + prepend(&res, &buflen, "", 1); error = prepend_path(path, root, &res, &buflen); if (error < 0) @@ -201,7 +201,7 @@ char *d_absolute_path(const struct path *path, char *res = buf + buflen; int error; - prepend(&res, &buflen, "\0", 1); + prepend(&res, &buflen, "", 1); error = prepend_path(path, &root, &res, &buflen); if (error > 1) @@ -218,7 +218,7 @@ static int path_with_deleted(const struct path *path, const struct path *root, char **buf, int *buflen) { - prepend(buf, buflen, "\0", 1); + prepend(buf, buflen, "", 1); if (d_unlinked(path->dentry)) { int error = prepend(buf, buflen, " (deleted)", 10); if (error) @@ -341,7 +341,7 @@ static char *__dentry_path(const struct dentry *d, char *buf, int buflen) dentry = d; end = buf + buflen; len = buflen; - prepend(&end, &len, "\0", 1); + prepend(&end, &len, "", 1); /* Get '/' right */ retval = end-1; *retval = '/'; @@ -444,7 +444,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size) char *cwd = page + PATH_MAX; int buflen = PATH_MAX; - prepend(&cwd, &buflen, "\0", 1); + prepend(&cwd, &buflen, "", 1); error = prepend_path(&pwd, &root, &cwd, &buflen); rcu_read_unlock(); -- 2.11.0