From c278e81b8a0291f5adce43c4613ad569d76dc384 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Tue, 3 Mar 2015 23:42:25 +0100 Subject: [PATCH] hostfs: Remove open coded strcpy() Signed-off-by: Richard Weinberger --- fs/hostfs/hostfs_kern.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 3082a7e715dd..7260f162db41 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -105,11 +105,10 @@ static char *__dentry_name(struct dentry *dentry, char *name) __putname(name); return NULL; } - if (p > name + len) { - char *s = name + len; - while ((*s++ = *p++) != '\0') - ; - } + + if (p > name + len) + strcpy(name + len, p); + return name; } -- 2.39.5