From: Florent Bruneau Date: Sat, 13 Sep 2008 07:39:06 +0000 (+0200) Subject: Fix off-by-one. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=b2ab973f97473bce4671264cbdeaa3ea4e8b5b85;p=apps%2Fpfixtools.git Fix off-by-one. Signed-off-by: Florent Bruneau --- diff --git a/common/trie.c b/common/trie.c index 7f0ff2d..2569dff 100644 --- a/common/trie.c +++ b/common/trie.c @@ -150,7 +150,7 @@ static inline int trie_entry_new(trie_t *trie) { const trie_entry_t e = TRIE_ENTRY_INIT; array_add(trie->entries, e); - return trie->entries.len; + return trie->entries.len - 1; } static inline int trie_add_leaf(trie_t *trie, const char *key)