From bb66f3cc3bc2a76d10f16e1206f35480eb250a07 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sat, 5 Nov 2011 16:05:18 +0100 Subject: Bug in trie fixed (issue 277) When there were both '0' and '255' subnodes in (mtrie) the removal of the node resulted in an infinite loop. Fixed. Signed-off-by: Martin Sustrik --- src/mtrie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mtrie.cpp') diff --git a/src/mtrie.cpp b/src/mtrie.cpp index 1c96c98..65b4fe8 100644 --- a/src/mtrie.cpp +++ b/src/mtrie.cpp @@ -171,7 +171,7 @@ void zmq::mtrie_t::rm_helper (pipe_t *pipe_, unsigned char **buff_, } // If there are multiple subnodes. - for (unsigned char c = 0; c != count; c++) { + for (unsigned short c = 0; c != count; c++) { (*buff_) [buffsize_] = min + c; if (next.table [c]) next.table [c]->rm_helper (pipe_, buff_, buffsize_ + 1, -- cgit v1.2.3