Skip to content
Snippets Groups Projects
Commit eb6345de authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

somewhat safer typecasting in case sizeof(long) != sizeof(void *) (is there

even such platforms?)
parent 0fd3b7a0
No related branches found
No related tags found
No related merge requests found
......@@ -1012,11 +1012,11 @@ static struct hostent* pack_hostent(char** buf, struct hostent* orig)
/* now, shrink the allocated buffer to the size we actually need, which
most often is only a fraction of the original alloc */
newbuf=(char *)realloc(*buf, (long)bufptr-(long)(*buf));
newbuf=(char *)realloc(*buf, (long)(bufptr-*buf));
/* if the alloc moved, we need to adjust things again */
if(newbuf != *buf)
hostcache_fixoffset((struct hostent*)newbuf, (long)newbuf-(long)*buf);
hostcache_fixoffset((struct hostent*)newbuf, (long)(newbuf-*buf));
/* setup the return */
*buf = newbuf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment