* string/string.h (strndupa): Add cast for C++ conformance.
authorAndreas Jaeger <aj@suse.de>
Mon, 2 Apr 2001 07:17:45 +0000 (07:17 +0000)
committerAndreas Jaeger <aj@suse.de>
Mon, 2 Apr 2001 07:17:45 +0000 (07:17 +0000)
(strdupa): Likewise.
Fixes PR libc/2173, reported by tbrowder@home.com.

string/string.h

index 6aee6e1..65769e9 100644 (file)
@@ -135,7 +135,7 @@ extern char *strndup (__const char *__string, size_t __n)
     ({                                                                       \
       __const char *__old = (s);                                             \
       size_t __len = strlen (__old) + 1;                                     \
-      char *__new = __builtin_alloca (__len);                                \
+      char *__new = (char *) __builtin_alloca (__len);                       \
       (char *) memcpy (__new, __old, __len);                                 \
     }))
 
@@ -145,7 +145,7 @@ extern char *strndup (__const char *__string, size_t __n)
     ({                                                                       \
       __const char *__old = (s);                                             \
       size_t __len = strnlen (__old, (n));                                   \
-      char *__new = __builtin_alloca (__len + 1);                            \
+      char *__new = (char *) __builtin_alloca (__len + 1);                   \
       __new[__len] = '\0';                                                   \
       (char *) memcpy (__new, __old, __len);                                 \
     }))