fix an off-by one, spotted by chance

This commit is contained in:
Fischlurch 2018-10-12 23:43:36 +02:00
parent fa6ba76f85
commit d2309f003d

View file

@ -112,9 +112,9 @@ namespace lib {
size_t hash=0;
if (literal)
{
size_t cnt = 1;
const char *pos = literal;
size_t maxpos = STRING_MAX_RELEVANT;
for ( ; *pos && --maxpos; ++pos)
for ( ; cnt <= STRING_MAX_RELEVANT and *pos ; ++cnt, ++pos )
hash_combine(hash, *pos);
}