aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/bucket.c4
-rw-r--r--src/falloc.c2
-rw-r--r--src/gdbmopen.c2
-rw-r--r--src/gdbmsetopt.c2
-rw-r--r--src/gdbmtool.c2
6 files changed, 7 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 0d2ca53..2710bf0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,7 +33,7 @@ BUILT_SOURCES = gdbm.h gram.h
33gram.h: gram.c 33gram.h: gram.c
34 34
35# The libraries 35# The libraries
36VI_CURRENT = 5 36VI_CURRENT = 6
37VI_REVISION = 0 37VI_REVISION = 0
38VI_AGE = 0 38VI_AGE = 0
39 39
diff --git a/src/bucket.c b/src/bucket.c
index a3e8f4e..4b69bbe 100644
--- a/src/bucket.c
+++ b/src/bucket.c
@@ -29,7 +29,7 @@ void
29_gdbm_new_bucket (GDBM_FILE dbf, hash_bucket *bucket, int bits) 29_gdbm_new_bucket (GDBM_FILE dbf, hash_bucket *bucket, int bits)
30{ 30{
31 int index; 31 int index;
32 32
33 /* Initialize the avail block. */ 33 /* Initialize the avail block. */
34 bucket->av_count = 0; 34 bucket->av_count = 0;
35 35
@@ -146,7 +146,7 @@ _gdbm_get_bucket (GDBM_FILE dbf, int dir_index)
146 if (!(bucket->count >= 0 146 if (!(bucket->count >= 0
147 && bucket->count <= dbf->header->bucket_elems 147 && bucket->count <= dbf->header->bucket_elems
148 && bucket->bucket_bits >= 0 148 && bucket->bucket_bits >= 0
149 && bucket->bucket_bits <= GDBM_HASH_BITS)) 149 && bucket->bucket_bits <= dbf->header->dir_bits))
150 { 150 {
151 GDBM_SET_ERRNO (dbf, GDBM_BAD_BUCKET, TRUE); 151 GDBM_SET_ERRNO (dbf, GDBM_BAD_BUCKET, TRUE);
152 return -1; 152 return -1;
diff --git a/src/falloc.c b/src/falloc.c
index 2f21ebe..6571d9b 100644
--- a/src/falloc.c
+++ b/src/falloc.c
@@ -292,7 +292,7 @@ push_avail_block (GDBM_FILE dbf)
292 av_adr = new_loc.av_adr; 292 av_adr = new_loc.av_adr;
293 293
294 /* Split the header block. */ 294 /* Split the header block. */
295 temp = malloc (av_size); 295 temp = calloc (1, av_size);
296 if (temp == NULL) 296 if (temp == NULL)
297 { 297 {
298 GDBM_SET_ERRNO (dbf, GDBM_MALLOC_ERROR, TRUE); 298 GDBM_SET_ERRNO (dbf, GDBM_MALLOC_ERROR, TRUE);
diff --git a/src/gdbmopen.c b/src/gdbmopen.c
index 03cc4f4..677f1cf 100644
--- a/src/gdbmopen.c
+++ b/src/gdbmopen.c
@@ -154,7 +154,7 @@ validate_header (gdbm_file_header const *hdr, struct stat const *st)
154 if (hdr->dir_bits != dir_bits) 154 if (hdr->dir_bits != dir_bits)
155 return GDBM_BAD_HEADER; 155 return GDBM_BAD_HEADER;
156 156
157 if (!(hdr->bucket_size > 0 && hdr->bucket_size > sizeof(hash_bucket))) 157 if (!(hdr->bucket_size > sizeof(hash_bucket)))
158 return GDBM_BAD_HEADER; 158 return GDBM_BAD_HEADER;
159 159
160 if (hdr->bucket_elems != bucket_element_count (hdr->bucket_size)) 160 if (hdr->bucket_elems != bucket_element_count (hdr->bucket_size))
diff --git a/src/gdbmsetopt.c b/src/gdbmsetopt.c
index f9face0..865f5a5 100644
--- a/src/gdbmsetopt.c
+++ b/src/gdbmsetopt.c
@@ -54,13 +54,13 @@ setopt_gdbm_setcachesize (GDBM_FILE dbf, void *optval, int optlen)
54{ 54{
55 size_t sz; 55 size_t sz;
56 56
57 /* Optval will point to the new size of the cache. */
58 if (dbf->bucket_cache != NULL) 57 if (dbf->bucket_cache != NULL)
59 { 58 {
60 GDBM_SET_ERRNO (dbf, GDBM_OPT_ALREADY_SET, FALSE); 59 GDBM_SET_ERRNO (dbf, GDBM_OPT_ALREADY_SET, FALSE);
61 return -1; 60 return -1;
62 } 61 }
63 62
63 /* Optval will point to the new size of the cache. */
64 if (get_size (optval, optlen, &sz)) 64 if (get_size (optval, optlen, &sz))
65 { 65 {
66 GDBM_SET_ERRNO (dbf, GDBM_OPT_ILLEGAL, FALSE); 66 GDBM_SET_ERRNO (dbf, GDBM_OPT_ILLEGAL, FALSE);
diff --git a/src/gdbmtool.c b/src/gdbmtool.c
index 6d56578..d0b2694 100644
--- a/src/gdbmtool.c
+++ b/src/gdbmtool.c
@@ -919,7 +919,7 @@ list_handler (struct handler_param *param)
919 data = gdbm_fetch (gdbm_file, key); 919 data = gdbm_fetch (gdbm_file, key);
920 if (!data.dptr) 920 if (!data.dptr)
921 { 921 {
922 terror (_("cannot fetch data; the key was:")); 922 terror (_("%s; the key was:"), gdbm_db_strerror (gdbm_file));
923 datum_format (stderr, &key, dsdef[DS_KEY]); 923 datum_format (stderr, &key, dsdef[DS_KEY]);
924 } 924 }
925 else 925 else

Return to:

Send suggestions and report system problems to the System administrator.