[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:
Andriy Gapon 2013-07-17 08:45:27 +00:00
parent 29b44b096f
commit 22423fd8a0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253413

View File

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