From 665203bba1276679f987d09352ba1f55497fba3b Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Fri, 3 Apr 2026 08:48:34 -0400 Subject: [PATCH] Corrected genhash() after Mitch Bailey pointed out that the function was no longer hashing on both values passed to the function, as it is supposed to. --- VERSION | 2 +- base/hash.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 77998f9..b3a4111 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.317 +1.5.318 diff --git a/base/hash.c b/base/hash.c index 46ea0b3..28bb94f 100644 --- a/base/hash.c +++ b/base/hash.c @@ -164,8 +164,10 @@ unsigned long hashcase(char *s, int hashsize) unsigned long genhash(char *s, int c, int hashsize) { unsigned long hashval = 2166136261ul; + hashval ^= (unsigned long)c; + hashval *= 16777619ul; for (; *s != '\0'; s++) { - hashval ^= (unsigned long)c; + hashval ^= (unsigned char)(*s); hashval *= 16777619ul; } return (hashsize == 0) ? hashval : (hashval % hashsize);