summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2021-05-17 21:11:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2021-05-17 21:11:45 -0400
commitdfe5087675e66f3cce8d98447bf01602f3cdea24 (patch)
treebb90342d312b2d6eaa8b9ecbf72d87bbafc307c8
parent6efb943b8616ec53a5e444193dccf1af9ad627b5 (diff)
d_path: "\0" is {0,0}, not {0}
Single-element array consisting of one NUL is spelled ""... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/d_path.c10
1 files 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 @@ restart:
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();