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 affac4d3 for ; Tue, 30 Aug 2016 16:37:55 -0500 (EST) Date: Tue, 30 Aug 2016 16:37:55 -0500 (EST) Message-Id: <13144150561200032402.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: less confusing warning message about negative offsets X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- less confusing warning message about negative offsets Modified Files: -------------- mdocml: dbm_map.c Revision Data ------------- Index: dbm_map.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/dbm_map.c,v retrieving revision 1.4 retrieving revision 1.5 diff -Ldbm_map.c -Ldbm_map.c -u -p -r1.4 -r1.5 --- dbm_map.c +++ dbm_map.c @@ -143,7 +143,11 @@ void * dbm_get(int32_t offset) { offset = be32toh(offset); - if (offset < 0 || offset >= max_offset) { + if (offset < 0) { + warnx("dbm_get: Database corrupt: offset %d", offset); + return NULL; + } + if (offset >= max_offset) { warnx("dbm_get: Database corrupt: offset %d > %d", offset, max_offset); return NULL; -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv