summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-04-12 06:55:25 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-04-12 06:55:25 +0000
commiteb6345de60e0bb9c742a41745a5aa480ecf6e064 (patch)
tree5535459905e42423f340ffd84f1f11ea4c7814b2
parent0fd3b7a00ab42af4795c2094af61057a5f7f9536 (diff)
downloadgnurl-eb6345de60e0bb9c742a41745a5aa480ecf6e064.tar.gz
gnurl-eb6345de60e0bb9c742a41745a5aa480ecf6e064.tar.bz2
gnurl-eb6345de60e0bb9c742a41745a5aa480ecf6e064.zip
somewhat safer typecasting in case sizeof(long) != sizeof(void *) (is there
even such platforms?)
-rw-r--r--lib/hostip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index c578f0674..941981587 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -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;