summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hashcomp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index 168bcbe0f..7df7960f9 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -87,7 +87,7 @@ size_t nspace::hash<string>::operator()(const string &s) const
* This avoids a copy to use hash<const char*>
*/
unsigned long t = 0;
- for (const char* x = s.c_str(); *x; x++)
+ for (const char* x = s.c_str(); *x; ++x) /* ++x not x++, so we don't hash the \0 */
t = 5 * t + lowermap[(unsigned char)*x];
return size_t(t);
}