summaryrefslogtreecommitdiff
path: root/name-hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'name-hash.c')
-rw-r--r--name-hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/name-hash.c b/name-hash.c
index d8d25c2..942c459 100644
--- a/name-hash.c
+++ b/name-hash.c
@@ -24,11 +24,11 @@ static unsigned int hash_name(const char *name, int namelen)
{
unsigned int hash = 0x123;
- do {
+ while (namelen--) {
unsigned char c = *name++;
c = icase_hash(c);
hash = hash*101 + c;
- } while (--namelen);
+ }
return hash;
}