From 8fd2a754f0de4537286816ea8f52b7184e7b2d3d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Oct 2016 23:18:52 +0200 Subject: [PATCH] memdup: use 'void *' as return and source type --- lib/strdup.c | 4 ++-- lib/strdup.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/strdup.c b/lib/strdup.c index 23f554e51..5a15c2b16 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -65,9 +65,9 @@ char *curlx_strdup(const char *str) * Returns the new pointer or NULL on failure. * ***************************************************************************/ -char *Curl_memdup(const char *src, size_t length) +void *Curl_memdup(const void *src, size_t length) { - char *buffer = malloc(length); + void *buffer = malloc(length); if(!buffer) return NULL; /* fail */ diff --git a/lib/strdup.h b/lib/strdup.h index 4c48ca412..c74a3b730 100644 --- a/lib/strdup.h +++ b/lib/strdup.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -26,6 +26,6 @@ #ifndef HAVE_STRDUP extern char *curlx_strdup(const char *str); #endif -char *Curl_memdup(const char *src, size_t buffer_length); +void *Curl_memdup(const void *src, size_t buffer_length); #endif /* HEADER_CURL_STRDUP_H */