summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-08-30 21:37:24 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-08-30 21:37:24 +0000
commit0e0452344b24af80d11d23280318f0886f06af54 (patch)
tree818eb76cceea58295c9862a6562cf36843bb5f2d
parent7b96be561b6468986e08aedac7c8aab7198f722c (diff)
downloadmandoc-0e0452344b24af80d11d23280318f0886f06af54.tar.gz
less confusing warning message about negative offsets
-rw-r--r--dbm_map.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dbm_map.c b/dbm_map.c
index 2d1315f6..d5d53395 100644
--- a/dbm_map.c
+++ b/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;