* sysdeps/generic/setenv.c: Avoid warning about uninitialized variable.
This commit is contained in:
Ulrich Drepper 1999-08-18 23:21:04 +00:00
parent 310f95183a
commit 96ff49374e
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,7 @@
1999-08-18 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/generic/setenv.c: Avoid warning about uninitialized variable.
* libio/fileops.c (_IO_file_xsgetn): Allocate buffer if none is
allocated so far. [PR libc/1261].

View File

@ -113,7 +113,7 @@ __add_to_environ (name, value, combined, replace)
const char *combined;
int replace;
{
register char **ep;
register char **ep = __environ;
register size_t size;
const size_t namelen = strlen (name);
const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
@ -121,16 +121,16 @@ __add_to_environ (name, value, combined, replace)
LOCK;
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] == '=')
break;
else
++size;
}
if (__environ == NULL || *ep == NULL)
if (ep == NULL || *ep == NULL)
{
char **new_environ;
#ifdef USE_TSEARCH