From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 9d41b16b for ; Thu, 4 Aug 2016 04:34:27 -0500 (EST) Date: Thu, 4 Aug 2016 04:34:27 -0500 (EST) Message-Id: <18435602313078182894.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Fix an assertion failure that happened when trying to add a page X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 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 , 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