From f0bdbf04c573205ec54e999b359710b52c412009 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 4 Aug 2016 09:33:57 +0000 Subject: Fix an assertion failure that happened when trying to add a page with makewhatis -d to a completely empty database. Reported by Mark Patruck , thanks! --- dba_read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dba_read.c') diff --git a/dba_read.c b/dba_read.c index f36c553c..52b655c5 100644 --- a/dba_read.c +++ b/dba_read.c @@ -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, -- cgit