summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/tagmap.h
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2010-12-12 09:50:47 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2010-12-12 09:50:47 +0000
commit84c873b4fdbf239ad4ba1c6d6be6926736cac516 (patch)
tree683c2a739e36044ce416a3d66ecb8b92263c202f /src/lib/util/tagmap.h
parenta615d1f6a69c424d0e79c3a801fa6f2534d1e7b5 (diff)
Fixed debug command symlist (bug #4131) [Robbbert]
Diffstat (limited to 'src/lib/util/tagmap.h')
-rw-r--r--src/lib/util/tagmap.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h
index 2a22ad74222..6124689c716 100644
--- a/src/lib/util/tagmap.h
+++ b/src/lib/util/tagmap.h
@@ -167,9 +167,13 @@ INLINE UINT32 tagmap_hash(const char *string)
UINT32 hash = (string[0] << 5) + string[1];
char c;
- string += 2;
- while ((c = *string++) != 0)
- hash = ((hash << 5) | (hash >> 27)) + c;
+ if (strlen(string) > 2)
+ {
+ string += 2;
+ while ((c = *string++) != 0)
+ hash = ((hash << 5) | (hash >> 27)) + c;
+ }
+
return hash;
}