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.
This commit is contained in:
R. Timothy Edwards 2026-04-03 08:48:34 -04:00
parent 0192558d4b
commit 665203bba1
2 changed files with 4 additions and 2 deletions

View File

@ -1 +1 @@
1.5.317
1.5.318

View File

@ -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);