From 861b647e7b1da564b831a5b07312a30feb7b6c58 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 6 Sep 2008 04:28:43 +0000 Subject: remove unnecessary typecasting of realloc() --- docs/examples/curlx.c | 2 +- docs/examples/getinmemory.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/examples') diff --git a/docs/examples/curlx.c b/docs/examples/curlx.c index bd192865f..521812b9a 100644 --- a/docs/examples/curlx.c +++ b/docs/examples/curlx.c @@ -469,7 +469,7 @@ int main(int argc, char **argv) { i+=lu; if (i== tabLength) { tabLength+=100; - binaryptr=(char*)realloc(binaryptr,tabLength); /* should be more careful */ + binaryptr=realloc(binaryptr,tabLength); /* should be more careful */ } } tabLength = i; 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; -- cgit v1.2.3