mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:53:37 +03:00
remove unnecessary typecasting of realloc()
This commit is contained in:
parent
70e57dad88
commit
861b647e7b
11 changed files with 14 additions and 14 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue