diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-04 09:33:57 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-04 09:33:57 +0000 |
commit | f0bdbf04c573205ec54e999b359710b52c412009 (patch) | |
tree | 85c50b7e4b2869160d0d9ab4432c863f315d5289 | |
parent | 42e4191ce53a7d77deef2b37ea6b3800cf463172 (diff) | |
download | mandoc-f0bdbf04c573205ec54e999b359710b52c412009.tar.gz |
Fix an assertion failure that happened when trying to add a page
with makewhatis -d to a completely empty database.
Reported by Mark Patruck <mark at wrapped dot cx>, thanks!
-rw-r--r-- | dba_read.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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, |