diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-30 21:37:24 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-30 21:37:24 +0000 |
commit | 0e0452344b24af80d11d23280318f0886f06af54 (patch) | |
tree | 818eb76cceea58295c9862a6562cf36843bb5f2d | |
parent | 7b96be561b6468986e08aedac7c8aab7198f722c (diff) | |
download | mandoc-0e0452344b24af80d11d23280318f0886f06af54.tar.gz |
less confusing warning message about negative offsets
-rw-r--r-- | dbm_map.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |