mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
[fix to r253380] __setenv: be explicit about placing '=' after name
This should a regression introduced in r253380 if malloc'ed memory happens to have '=' at the right place. Reported by: ache Pointyhat to: me (avg) MFC after: 1 day X-MFC with: r253380
This commit is contained in:
parent
29b44b096f
commit
22423fd8a0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253413
@ -506,8 +506,7 @@ __setenv(const char *name, size_t nameLen, const char *value, int overwrite)
|
||||
|
||||
/* Save name of name/value pair. */
|
||||
env = stpncpy(envVars[envNdx].name, name, nameLen);
|
||||
if ((envVars[envNdx].name)[nameLen] != '=')
|
||||
env = stpcpy(env, "=");
|
||||
*env++ = '=';
|
||||
}
|
||||
else
|
||||
env = envVars[envNdx].value;
|
||||
|
Loading…
Reference in New Issue
Block a user