about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-07-28 20:44:03 +0000
committerUlrich Drepper <drepper@redhat.com>2007-07-28 20:44:03 +0000
commit9d9febc7952c43f90fd81ce185e4b1a74cb13375 (patch)
treee53f5184345c494c12c38f59bdd088cbb61160fe
parent701666b77d9bc02a8dce61adcf02d2b929a2f95a (diff)
downloadglibc-9d9febc7952c43f90fd81ce185e4b1a74cb13375.tar.gz
glibc-9d9febc7952c43f90fd81ce185e4b1a74cb13375.tar.xz
glibc-9d9febc7952c43f90fd81ce185e4b1a74cb13375.zip
* nscd/selinux.c (preserve_capabilities): Initialize new_caps
	to avoid warning.
	* iconv/gconv_open.c (__gconv_open): Initialize ptr to avoid
	warning.
	* nis/nis_subr.c (nis_getnames): Initialize saveptr to avoid
	warning.
	* resolv/inet_ntop.c (inet_ntop6): Initialize best.len and cur.len
	to avoid warnings.
-rw-r--r--ChangeLog9
-rw-r--r--iconv/gconv_open.c4
-rw-r--r--nis/nis_subr.c2
-rw-r--r--nscd/selinux.c2
-rw-r--r--resolv/inet_ntop.c2
5 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e06c0721e..4dd0649628 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
 
+	* nscd/selinux.c (preserve_capabilities): Initialize new_caps
+	to avoid warning.
+	* iconv/gconv_open.c (__gconv_open): Initialize ptr to avoid
+	warning.
+	* nis/nis_subr.c (nis_getnames): Initialize saveptr to avoid
+	warning.
+	* resolv/inet_ntop.c (inet_ntop6): Initialize best.len and cur.len
+	to avoid warnings.
+
 	* nss/nsswitch.c (__nss_lookup_function): Don't cast &ni->known to
 	void **.
 	* nss/nsswitch.h (service_user): Use void * type for KNOWN field.
diff --git a/iconv/gconv_open.c b/iconv/gconv_open.c
index bbf27b3dc5..07ebb9b959 100644
--- a/iconv/gconv_open.c
+++ b/iconv/gconv_open.c
@@ -1,5 +1,5 @@
 /* Find matching transformation algorithms and initialize steps.
-   Copyright (C) 1997,1998,1999,2000,2001,2004,2005
+   Copyright (C) 1997,1998,1999,2000,2001,2004,2005,2007
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -56,7 +56,7 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
 	  /* Make copy without the error handling description.  */
 	  char *newtoset = (char *) alloca (errhand - toset + 1);
 	  char *tok;
-	  char *ptr;
+	  char *ptr = NULL /* Work around a bogus warning */;
 
 	  newtoset[errhand - toset] = '\0';
 	  toset = memcpy (newtoset, toset, errhand - toset);
diff --git a/nis/nis_subr.c b/nis/nis_subr.c
index c68189e541..abe51a9996 100644
--- a/nis/nis_subr.c
+++ b/nis/nis_subr.c
@@ -112,7 +112,7 @@ nis_getnames (const_nis_name name)
   size_t name_len = strlen (name);
   char *path;
   int pos = 0;
-  char *saveptr;
+  char *saveptr = NULL;
   int have_point;
   const char *cp;
   const char *cp2;
diff --git a/nscd/selinux.c b/nscd/selinux.c
index f2dbceeea1..6cbcbea19c 100644
--- a/nscd/selinux.c
+++ b/nscd/selinux.c
@@ -180,7 +180,7 @@ preserve_capabilities (void)
     }
 
   cap_t tmp_caps = cap_init ();
-  cap_t new_caps;
+  cap_t new_caps = NULL;
   if (tmp_caps != NULL)
     new_caps = cap_init ();
 
diff --git a/resolv/inet_ntop.c b/resolv/inet_ntop.c
index 1222d08bda..6e89f2d058 100644
--- a/resolv/inet_ntop.c
+++ b/resolv/inet_ntop.c
@@ -138,6 +138,8 @@ inet_ntop6(src, dst, size)
 		words[i / 2] = (src[i] << 8) | src[i + 1];
 	best.base = -1;
 	cur.base = -1;
+	best.len = 0;
+	cur.len = 0;
 	for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
 		if (words[i] == 0) {
 			if (cur.base == -1)