* mdocml: Fix an assertion failure that happened when trying to add a page
@ 2016-08-04 9:34 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2016-08-04 9:34 UTC (permalink / raw)
To: source
Log Message:
-----------
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!
Modified Files:
--------------
mdocml:
dba_read.c
Revision Data
-------------
Index: dba_read.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/dba_read.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ldba_read.c -Ldba_read.c -u -p -r1.1 -r1.2
--- dba_read.c
+++ 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,
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-04 9:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04 9:34 mdocml: Fix an assertion failure that happened when trying to add a page schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).