fix an off-by one, spotted by chance
This commit is contained in:
parent
fa6ba76f85
commit
d2309f003d
1 changed files with 2 additions and 2 deletions
|
|
@ -112,9 +112,9 @@ namespace lib {
|
||||||
size_t hash=0;
|
size_t hash=0;
|
||||||
if (literal)
|
if (literal)
|
||||||
{
|
{
|
||||||
|
size_t cnt = 1;
|
||||||
const char *pos = literal;
|
const char *pos = literal;
|
||||||
size_t maxpos = STRING_MAX_RELEVANT;
|
for ( ; cnt <= STRING_MAX_RELEVANT and *pos ; ++cnt, ++pos )
|
||||||
for ( ; *pos && --maxpos; ++pos)
|
|
||||||
hash_combine(hash, *pos);
|
hash_combine(hash, *pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue