]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Bertrand Jacquin <beber@meleeweb.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 25 Apr 2009 02:08:06 +0000 (14:08 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 25 Apr 2009 02:08:06 +0000 (14:08 +1200)
Make gcc-4.3 happy with strdup/strndup

Several casting void* to char* fixed.

lib/util.c

index 8f48a267f4cab8a573e1251262f52a1f6be22e0d..a48a6f0637fcb4e9f1c0e332da38035cb0e50b43 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);