summaryrefslogtreecommitdiffstats
path: root/lib/libstand/sbrk.c
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2004-10-03 15:58:20 +0000
committerstefanf <stefanf@FreeBSD.org>2004-10-03 15:58:20 +0000
commit06aa92a1b805a79ccf1e4d918298ab3c7b078a39 (patch)
tree2f283732548b11bf0e682b76a522ad0fe86c753e /lib/libstand/sbrk.c
parentf3f8ad79f64bcb2e92d92cfd6a77a532d50b8ca9 (diff)
downloadFreeBSD-src-06aa92a1b805a79ccf1e4d918298ab3c7b078a39.zip
FreeBSD-src-06aa92a1b805a79ccf1e4d918298ab3c7b078a39.tar.gz
Don't add integers to void pointers.
Diffstat (limited to 'lib/libstand/sbrk.c')
-rw-r--r--lib/libstand/sbrk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libstand/sbrk.c b/lib/libstand/sbrk.c
index b6245f9..93d94e4 100644
--- a/lib/libstand/sbrk.c
+++ b/lib/libstand/sbrk.c
@@ -42,7 +42,7 @@ setheap(void *base, void *top)
{
/* Align start address to 16 bytes for the malloc code. Sigh. */
heapbase = (void *)(((uintptr_t)base + 15) & ~15);
- maxheap = top - heapbase;
+ maxheap = (char *)top - (char *)heapbase;
}
char *
@@ -51,7 +51,7 @@ sbrk(int incr)
char *ret;
if ((heapsize + incr) <= maxheap) {
- ret = heapbase + heapsize;
+ ret = (char *)heapbase + heapsize;
bzero(ret, incr);
heapsize += incr;
return(ret);
OpenPOWER on IntegriCloud