aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-09-07 22:43:28 +0200
committerDaniel Stenberg <daniel@haxx.se>2011-09-07 22:43:28 +0200
commit450975b0c34bcc9659cbb963460b3e4d0df43543 (patch)
tree296ebd43321089de688ca74c1f183d847f21b7e1
parent5658aa95741cc2d69f4a70d7e7ba6dfb773258e3 (diff)
getinmemory.c: use better argument names for write callback
-rw-r--r--docs/examples/getinmemory.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c
index b5b34d4f0..78e6deb10 100644
--- a/docs/examples/getinmemory.c
+++ b/docs/examples/getinmemory.c
@@ -36,10 +36,10 @@ struct MemoryStruct {
static size_t
-WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
+WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
size_t realsize = size * nmemb;
- struct MemoryStruct *mem = (struct MemoryStruct *)data;
+ struct MemoryStruct *mem = (struct MemoryStruct *)userp;
mem->memory = realloc(mem->memory, mem->size + realsize + 1);
if (mem->memory == NULL) {
@@ -48,7 +48,7 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
exit(EXIT_FAILURE);
}
- memcpy(&(mem->memory[mem->size]), ptr, realsize);
+ memcpy(&(mem->memory[mem->size]), contents, realsize);
mem->size += realsize;
mem->memory[mem->size] = 0;