ash: use mempcpy() where appropriate

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-07-21 18:51:29 +02:00
parent fd5e66eb8e
commit da2244fe48

View File

@ -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);