aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/getinmemory.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-09-06 04:28:43 +0000
committerYang Tse <yangsita@gmail.com>2008-09-06 04:28:43 +0000
commit861b647e7b1da564b831a5b07312a30feb7b6c58 (patch)
tree0bf8f137e7db222deefccc94fe3a22eecadba7d8 /docs/examples/getinmemory.c
parent70e57dad8856c2b99d947344661ae260c6fff594 (diff)
remove unnecessary typecasting of realloc()
Diffstat (limited to 'docs/examples/getinmemory.c')
-rw-r--r--docs/examples/getinmemory.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c
index fc1f87a91..c92482166 100644
--- a/docs/examples/getinmemory.c
+++ b/docs/examples/getinmemory.c
@@ -26,6 +26,8 @@ struct MemoryStruct {
size_t size;
};
+static void *myrealloc(void *ptr, size_t size);
+
static void *myrealloc(void *ptr, size_t size)
{
/* There might be a realloc() out there that doesn't like reallocing
@@ -42,7 +44,7 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
size_t realsize = size * nmemb;
struct MemoryStruct *mem = (struct MemoryStruct *)data;
- mem->memory = (char *)myrealloc(mem->memory, mem->size + realsize + 1);
+ mem->memory = myrealloc(mem->memory, mem->size + realsize + 1);
if (mem->memory) {
memcpy(&(mem->memory[mem->size]), ptr, realsize);
mem->size += realsize;