about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-05 21:21:08 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-05 21:21:08 +0000
commita83b5649c561758f914a4e393c42fbb595852cf7 (patch)
treeda2cb831050c80cb7130a109aa60f49e1fd767b7
parent3e6ce4d77e489c7ca333c6b56b1386b20927f678 (diff)
downloadglibc-a83b5649c561758f914a4e393c42fbb595852cf7.tar.gz
glibc-a83b5649c561758f914a4e393c42fbb595852cf7.tar.xz
glibc-a83b5649c561758f914a4e393c42fbb595852cf7.zip
[BZ #5113]
	* string/bits/string2.h (__strdup): Cast parameters to calloc to
	avoid warning with -Wconversion.
	(__strndup): Likewise.
	Patch to 50% by Christian Iseli <christian.iseli@licr.org>.
-rw-r--r--ChangeLog6
-rw-r--r--string/bits/string2.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a1ba69b3c7..6e830311a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-10-05  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #5113]
+	* string/bits/string2.h (__strdup): Cast parameters to calloc to
+	avoid warning with -Wconversion.
+	(__strndup): Likewise.
+	Patch to 50% by Christian Iseli <christian.iseli@licr.org>.
+
 	[BZ #5112]
 	* nscd/connections.c (restart): Don't resync if database is
 	disabled.  Patch mostly by Brian De Wolf <bldewolf@csupomona.edu>.
diff --git a/string/bits/string2.h b/string/bits/string2.h
index 1e4d736a17..6a18a1afc6 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -1305,7 +1305,7 @@ extern char *__strdup (__const char *__string) __THROW __attribute_malloc__;
 #  define __strdup(s) \
   (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
 		  ? (((__const char *) (s))[0] == '\0'			      \
-		     ? (char *) calloc (1, 1)				      \
+		     ? (char *) calloc ((size_t) 1, (size_t) 1)		      \
 		     : ({ size_t __len = strlen (s) + 1;		      \
 			  char *__retval = (char *) malloc (__len);	      \
 			  if (__retval != NULL)				      \
@@ -1325,7 +1325,7 @@ extern char *__strndup (__const char *__string, size_t __n)
 #  define __strndup(s, n) \
   (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
 		  ? (((__const char *) (s))[0] == '\0'			      \
-		     ? (char *) calloc (1, 1)				      \
+		     ? (char *) calloc ((size_t) 1, (size_t) 1)		      \
 		     : ({ size_t __len = strlen (s) + 1;		      \
 			  size_t __n = (n);				      \
 			  char *__retval;				      \