(__add_to_environ): Initialize ep after we have the lock.

Avoid warning about uninitialized variable.
This commit is contained in:
Ulrich Drepper 1999-08-19 20:11:33 +00:00
parent 336c2454d6
commit 9c4140bada

View File

@ -120,17 +120,21 @@ __add_to_environ (name, value, combined, replace)
LOCK; LOCK;
/* We have to get the pointer now that we have the lock and not earlier
since another thread might have created a new environment. */
ep = __environ;
size = 0; size = 0;
if (__environ != NULL) if (ep != NULL)
{ {
for (ep = __environ; *ep != NULL; ++ep) for (; *ep != NULL; ++ep)
if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=') if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
break; break;
else else
++size; ++size;
} }
if (__environ == NULL || *ep == NULL) if (ep == NULL || *ep == NULL)
{ {
char **new_environ; char **new_environ;
#ifdef USE_TSEARCH #ifdef USE_TSEARCH