Skip to content

Commit

Permalink
getinmemory.c: use better argument names for write callback
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Sep 7, 2011
1 parent 5658aa9 commit 450975b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/examples/getinmemory.c
Expand Up @@ -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) {
Expand All @@ -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;

Expand Down

0 comments on commit 450975b

Please sign in to comment.