summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-01-05 23:30:41 +0000
committerphk <phk@FreeBSD.org>1996-01-05 23:30:41 +0000
commitccd7b7cc3f86658d755de89e06b2389c150642c3 (patch)
tree5251f173a9481c253396374b26fbaf4d3772e5e0 /lib/libc
parent5d8adcbf4e291724a2348beb88b94c9948ea4289 (diff)
downloadFreeBSD-src-ccd7b7cc3f86658d755de89e06b2389c150642c3.zip
FreeBSD-src-ccd7b7cc3f86658d755de89e06b2389c150642c3.tar.gz
Fix a fencepost error.
Found by: Lars Fredriksen <fredriks@mcs.com>
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/malloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index d906774..4299028 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: malloc.c,v 1.7 1995/12/11 14:28:12 peter Exp $
+ * $Id: malloc.c,v 1.8 1995/12/18 12:03:54 phk Exp $
*
*/
@@ -362,7 +362,7 @@ malloc_exit()
* Allocate a number of pages from the OS
*/
static caddr_t
-map_pages(int pages, int update)
+map_pages(int pages)
{
caddr_t result,tail;
@@ -379,7 +379,7 @@ map_pages(int pages, int update)
last_index = ptr2index(tail) - 1;
malloc_brk = tail;
- if (update && last_index >= malloc_ninfo && !extend_pgdir(last_index))
+ if ((last_index+1) >= malloc_ninfo && !extend_pgdir(last_index))
return 0;;
return result;
@@ -664,7 +664,7 @@ malloc_pages(size_t size)
/* Map new pages */
if (!p)
- p = map_pages(size,1);
+ p = map_pages(size);
if (p) {
OpenPOWER on IntegriCloud