summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-09-08 21:33:18 +0000
committerJeremy Allison <jra@samba.org>2003-09-08 21:33:18 +0000
commite99b77985d790e1b607b914b437c76a558bd0240 (patch)
tree37c5652e6ce02fb24d8b6a3c0fd12e41a7b46716
parent16e6d22408cd00852bc1a796815e77820d0df788 (diff)
downloadsamba-e99b77985d790e1b607b914b437c76a558bd0240.tar.gz
Don't double-increment p in hash calculation. Found by valgrind.
Jeremy. (This used to be commit 514d9361c7be8cb8ef1a1309773baab1d982eea6)
-rw-r--r--source3/lib/hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/hash.c b/source3/lib/hash.c
index cd77b0b421b..18b6534dec2 100644
--- a/source3/lib/hash.c
+++ b/source3/lib/hash.c
@@ -93,7 +93,7 @@ static int string_hash(int hash_size, const char *key)
u32 n = 0;
const char *p;
for (p = key; *p != '\0'; p++) {
- n = ((n << 5) + n) ^ (u32)(*p++);
+ n = ((n << 5) + n) ^ (u32)(*p);
}
return (n % hash_size);
}