From e1c459c907fc12e58387b82ed5cea48875dbd97f Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 22 Apr 2009 00:16:13 +1200 Subject: [PATCH] Author: Bertrand Jacquin Make gcc-4.3 happy with strdup/strndup Several casting void* to char* fixed. --- lib/util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); -- 2.47.2