git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fc0e52
)
Don't double-increment p in hash calculation. Found by valgrind.
author
Jeremy Allison
<jra@samba.org>
Mon, 8 Sep 2003 21:33:18 +0000
(21:33 +0000)
committer
Jeremy Allison
<jra@samba.org>
Mon, 8 Sep 2003 21:33:18 +0000
(21:33 +0000)
Jeremy.
source/lib/hash.c
patch
|
blob
|
history
diff --git
a/source/lib/hash.c
b/source/lib/hash.c
index cd77b0b421b10d4e5e103ac9938e32da7b0ca7d5..18b6534dec2fb27be0cbe76dac461f20e4ead751 100644
(file)
--- a/
source/lib/hash.c
+++ b/
source/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);
}