summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-07-21 18:51:29 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-21 18:51:29 +0200
commitda2244fe48b7f1223427a4c1e91d86e398bbceb4 (patch)
treeace4f9150179e9f56c3965751947dcedd1da974d
parentfd5e66eb8eb4e39460a6cfde4b10dcab3870f26b (diff)
ash: use mempcpy() where appropriate
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index a461bb7df..c8b2adf4e 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2315,10 +2315,10 @@ setvar(const char *name, const char *val, int flags)
INT_OFF;
nameeq = ckmalloc(namelen + vallen + 2);
- p = memcpy(nameeq, name, namelen) + namelen;
+ p = mempcpy(nameeq, name, namelen);
if (val) {
*p++ = '=';
- p = memcpy(p, val, vallen) + vallen;
+ p = mempcpy(p, val, vallen);
}
*p = '\0';
setvareq(nameeq, flags | VNOSAVE);