summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/dba_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mandoc/dba_read.c')
-rw-r--r--usr.bin/mandoc/dba_read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mandoc/dba_read.c b/usr.bin/mandoc/dba_read.c
index c7128de2849..b260ac1fca7 100644
--- a/usr.bin/mandoc/dba_read.c
+++ b/usr.bin/mandoc/dba_read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dba_read.c,v 1.1 2016/08/01 10:32:39 schwarze Exp $ */
+/* $OpenBSD: dba_read.c,v 1.2 2016/08/04 09:33:53 schwarze Exp $ */
/*
* Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -45,7 +45,7 @@ dba_read(const char *fname)
if (dbm_open(fname) == -1)
return NULL;
npages = dbm_page_count();
- dba = dba_new(npages);
+ dba = dba_new(npages < 128 ? 128 : npages);
for (ip = 0; ip < npages; ip++) {
pdata = dbm_page_get(ip);
page = dba_page_new(dba->pages, pdata->name, pdata->sect,