diff options
author | Ulrich Drepper <drepper@redhat.com> | 2007-10-05 21:21:08 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2007-10-05 21:21:08 +0000 |
commit | a83b5649c561758f914a4e393c42fbb595852cf7 (patch) | |
tree | da2cb831050c80cb7130a109aa60f49e1fd767b7 /string/bits/string2.h | |
parent | 3e6ce4d77e489c7ca333c6b56b1386b20927f678 (diff) | |
download | glibc-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>.
Diffstat (limited to 'string/bits/string2.h')
-rw-r--r-- | string/bits/string2.h | 4 |
1 files changed, 2 insertions, 2 deletions
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; \ |