summaryrefslogtreecommitdiff
path: root/src/prefix_tree.hpp
diff options
context:
space:
mode:
authorJon Dyte <jon@totient.co.uk>2010-09-02 07:52:02 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-02 07:52:02 +0200
commit14853c2db528b3fd6eed84786053549e71f61bb7 (patch)
tree5d1aded1753d0743508e9795c0cd81f8de234cb0 /src/prefix_tree.hpp
parent8ec0743c7551de3c76126d080961cece732370f1 (diff)
Prior to this patch prefix_tree asserts.
This is because as it adds the 255th element at a node it attempts to calculate the count member var which is an unsigned char via count = (255 -0) + 1; and pass the result to realloc. Unfortunately the result is zero and realloc returns null; the prefix_tree asserts. I have fixed it by making the count an unsigned short.
Diffstat (limited to 'src/prefix_tree.hpp')
-rw-r--r--src/prefix_tree.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/prefix_tree.hpp b/src/prefix_tree.hpp
index 53c7c18..bf1c4b9 100644
--- a/src/prefix_tree.hpp
+++ b/src/prefix_tree.hpp
@@ -42,7 +42,7 @@ namespace zmq
uint32_t refcnt;
unsigned char min;
- unsigned char count;
+ unsigned short count;
union {
class prefix_tree_t *node;
class prefix_tree_t **table;