mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-26 06:50:07 +00:00
Update.
* sysdeps/generic/setenv.c: Avoid warning about uninitialized variable.
This commit is contained in:
parent
310f95183a
commit
96ff49374e
@ -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].
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user