aboutsummaryrefslogtreecommitdiffstats
path: root/src/fids/db.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fids/db.c')
-rw-r--r--src/fids/db.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/fids/db.c b/src/fids/db.c
index e0021bc48..35caf7eeb 100644
--- a/src/fids/db.c
+++ b/src/fids/db.c
@@ -32,11 +32,10 @@ static DB *database[HASH_MAX] = {NULL};
32 32
33// djb2 hash function by Dan Bernstein 33// djb2 hash function by Dan Bernstein
34static unsigned hash(const char *str) { 34static unsigned hash(const char *str) {
35 const unsigned char *s = (unsigned char *) str;
36 unsigned long hash = 5381; 35 unsigned long hash = 5381;
37 int c; 36 int c;
38 37
39 while (c = *s++) 38 while ((c = *str++) != '\0')
40 hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ 39 hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
41 40
42 return hash & (HASH_MAX - 1); 41 return hash & (HASH_MAX - 1);