* mdocml: less confusing warning message about negative offsets
@ 2016-08-30 21:37 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2016-08-30 21:37 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-30 21:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-30 21:37 mdocml: less confusing warning message about negative offsets 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).