summaryrefslogtreecommitdiffabout
path: root/src/gdbmdefs.h
Side-by-side diff
Diffstat (limited to 'src/gdbmdefs.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gdbmdefs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gdbmdefs.h b/src/gdbmdefs.h
index bd104e2..5305b0d 100644
--- a/src/gdbmdefs.h
+++ b/src/gdbmdefs.h
@@ -51,6 +51,13 @@ typedef struct
avail_elem av_table[1]; /* The table. Make it look like an array. */
} avail_block;
+/* Return true if avail_block is valid */
+static int inline
+gdbm_avail_block_valid_p (avail_block const *av)
+{
+ return (av->size >= 0 && av->count >= 0 && av->count <= av->size);
+}
+
/* The dbm file header keeps track of the current location of the hash
directory and the free space in the file. */

Return to:

Send suggestions and report system problems to the System administrator.