about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-08-18 23:21:04 +0000
committerUlrich Drepper <drepper@redhat.com>1999-08-18 23:21:04 +0000
commit96ff49374e18f70784697f776160088474780c61 (patch)
tree982406a3fcb2cb72d61d8eb6c3396cd7d4f293df
parent310f95183a026af2d7854f830b185116aa770852 (diff)
downloadglibc-96ff49374e18f70784697f776160088474780c61.tar.gz
glibc-96ff49374e18f70784697f776160088474780c61.tar.xz
glibc-96ff49374e18f70784697f776160088474780c61.zip
Update.
	* sysdeps/generic/setenv.c: Avoid warning about uninitialized variable.
-rw-r--r--ChangeLog2
-rw-r--r--sysdeps/generic/setenv.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index caa5a5a47a..69294b6344 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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].
 
diff --git a/sysdeps/generic/setenv.c b/sysdeps/generic/setenv.c
index fc58e9b346..387152dcad 100644
--- a/sysdeps/generic/setenv.c
+++ b/sysdeps/generic/setenv.c
@@ -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