strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
aliascnt++;
if ((aliascnt%8)==0)
- aliases = (char **) realloc(aliases, (aliascnt/16+1) * sizeof(char *));
+ aliases = realloc(aliases, (aliascnt/16+1) * sizeof(char *));
}
if (rr_class == C_IN && rr_type == T_CNAME)
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;
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
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;
do {
cursize *= 2;
- buf = (unsigned char *)realloc(buf, cursize);
+ buf = realloc(buf, cursize);
memset(buf + len, 0, cursize - len);
lastread = fread(buf + len, 1, cursize - len, stdin);
len += lastread;
if(in->buffer)
/* we have a buffer, enlarge the existing one */
- new_rb = (char *)realloc(in->buffer, new_size);
+ new_rb = realloc(in->buffer, new_size);
else
/* create a new buffer */
new_rb = (char *)malloc(new_size);
char *ptr;
if(conn->trlMax) {
conn->trlMax *= 2;
- ptr = (char*)realloc(conn->trailer,conn->trlMax);
+ ptr = realloc(conn->trailer,conn->trlMax);
}
else {
conn->trlMax=128;
}
/* append CRLF to the userpwd header */
- tmp = (char*) realloc(*allocuserpwd, strlen(*allocuserpwd) + 3 + 1);
+ tmp = realloc(*allocuserpwd, strlen(*allocuserpwd) + 3 + 1);
if(!tmp)
return CURLE_OUT_OF_MEMORY;
strcat(tmp, "\r\n");
else if(infop->len+1 >= infop->alloc) {
char *newptr;
- newptr = (char *)realloc(infop->buffer, infop->alloc*2);
+ newptr = realloc(infop->buffer, infop->alloc*2);
if(!newptr) {
infop->fail = 1;
size_t newsize=CURLMAX((k->hbuflen+*nread)*3/2,
data->state.headersize*2);
hbufp_index = k->hbufp - data->state.headerbuff;
- newbuff = (char *)realloc(data->state.headerbuff, newsize);
+ newbuff = realloc(data->state.headerbuff, newsize);
if(!newbuff) {
failf (data, "Failed to alloc memory for big header!");
return CURLE_OUT_OF_MEMORY;
size_t newsize=CURLMAX((k->hbuflen+full_length)*3/2,
data->state.headersize*2);
hbufp_index = k->hbufp - data->state.headerbuff;
- newbuff = (char *)realloc(data->state.headerbuff, newsize);
+ newbuff = realloc(data->state.headerbuff, newsize);
if(!newbuff) {
failf (data, "Failed to alloc memory for big header!");
return CURLE_OUT_OF_MEMORY;
data->state.lastconnect = -1;
}
if(newamount > 0) {
- newptr= (struct connectdata **)
- realloc(c->connects, sizeof(struct connectdata *) * newamount);
+ newptr = realloc(c->connects, sizeof(struct connectdata *) * newamount);
if(!newptr)
/* we closed a few connections in vain, but so what? */
return CURLE_OUT_OF_MEMORY;
if (nargs >= lformlen) {
lformlen += ALLOC_GRANULE;
- tforms = (struct curl_forms *) realloc((char *) lforms,
- lformlen * sizeof *lforms);
+ tforms = realloc(lforms, lformlen * sizeof *lforms);
if (!tforms) {
result = CURL_FORMADD_MEMORY;