]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Bertrand Jacquin <beber@meleeweb.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 21 Apr 2009 12:16:13 +0000 (00:16 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 21 Apr 2009 12:16:13 +0000 (00:16 +1200)
Make gcc-4.3 happy with strdup/strndup

Several casting void* to char* fixed.

lib/util.c

index 40fa49d866043c431fb4be6a1b4695a5af3cfcb2..199d74db29c940469740d4cc293ea17bc3c14b7b 100644 (file)
@@ -735,7 +735,7 @@ char *
 xstrdup(const char *s)
 {
     size_t sz;
-    void *p;
+    char *p;
     PROF_start(xstrdup);
 
     if (s == NULL) {
@@ -751,7 +751,7 @@ xstrdup(const char *s)
     /* copy string, including terminating character */
     sz = strlen(s) + 1;
 
-    p = memcpy(xmalloc(sz), s, sz);
+    p = memcpy((char *)xmalloc(sz), s, sz);
 
     PROF_stop(xstrdup);
 
@@ -765,7 +765,7 @@ char *
 xstrndup(const char *s, size_t n)
 {
     size_t sz;
-    void *p;
+    char *p;
     PROF_start(xstrndup);
     assert(s != NULL);
     assert(n);
@@ -774,7 +774,7 @@ xstrndup(const char *s, size_t n)
     if (sz > n)
         sz = n;
 
-    p = xstrncpy(xmalloc(sz), s, sz);
+    p = xstrncpy((char *)xmalloc(sz), s, sz);
 
     PROF_stop(xstrndup);