Make gcc-4.3 happy with strdup/strndup
Several casting void* to char* fixed.
xstrdup(const char *s)
{
size_t sz;
- void *p;
+ char *p;
PROF_start(xstrdup);
if (s == NULL) {
/* 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);
xstrndup(const char *s, size_t n)
{
size_t sz;
- void *p;
+ char *p;
PROF_start(xstrndup);
assert(s != NULL);
assert(n);
if (sz > n)
sz = n;
- p = xstrncpy(xmalloc(sz), s, sz);
+ p = xstrncpy((char *)xmalloc(sz), s, sz);
PROF_stop(xstrndup);