From: Amos Jeffries Date: Tue, 21 Apr 2009 12:16:13 +0000 (+1200) Subject: Author: Bertrand Jacquin X-Git-Tag: SQUID_3_2_0_1~1056 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1c459c907fc12e58387b82ed5cea48875dbd97f;p=thirdparty%2Fsquid.git Author: Bertrand Jacquin Make gcc-4.3 happy with strdup/strndup Several casting void* to char* fixed. --- diff --git a/lib/util.c b/lib/util.c index 40fa49d866..199d74db29 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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);