diff options
Diffstat (limited to 'gvdb')
-rw-r--r-- | gvdb/gvdb-builder.c | 4 | ||||
-rw-r--r-- | gvdb/gvdb-reader.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gvdb/gvdb-builder.c b/gvdb/gvdb-builder.c index 4b48d80..91adec6 100644 --- a/gvdb/gvdb-builder.c +++ b/gvdb/gvdb-builder.c @@ -24,7 +24,9 @@ #include <glib.h> #include <fcntl.h> +#if !defined(G_OS_WIN32) || !defined(_MSC_VER) #include <unistd.h> +#endif #include <string.h> @@ -91,7 +93,7 @@ djb_hash (const gchar *key) guint32 hash_value = 5381; while (*key) - hash_value = hash_value * 33 + *key++; + hash_value = hash_value * 33 + *(signed char *)key++; return hash_value; } diff --git a/gvdb/gvdb-reader.c b/gvdb/gvdb-reader.c index 73f4f13..57816af 100644 --- a/gvdb/gvdb-reader.c +++ b/gvdb/gvdb-reader.c @@ -254,7 +254,7 @@ gvdb_table_lookup (GvdbTable *file, return NULL; for (key_length = 0; key[key_length]; key_length++) - hash_value = (hash_value * 33) + key[key_length]; + hash_value = (hash_value * 33) + ((signed char *) key)[key_length]; if (!gvdb_table_bloom_filter (file, hash_value)) return NULL; |