diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-16 13:44:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-16 13:44:35 +0000 |
commit | 3256178a2433f242f69c55f6eaee36ea314b2f1a (patch) | |
tree | 69323a953a69d4d62c9c57e695c6f84ac9527bb8 /src/libutil/expression.c | |
parent | 5c25ee027e883ea5251958ecee14ea5fc3e68946 (diff) | |
download | rspamd-3256178a2433f242f69c55f6eaee36ea314b2f1a.tar.gz rspamd-3256178a2433f242f69c55f6eaee36ea314b2f1a.zip |
Fix couple of issues found by gcc-6
Diffstat (limited to 'src/libutil/expression.c')
-rw-r--r-- | src/libutil/expression.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c index 12186b796..2bbc5fa3b 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -476,6 +476,7 @@ rspamd_ast_priority_cmp (GNode *a, GNode *b) struct rspamd_expression_elt *ea = a->data, *eb = b->data; gdouble w1, w2; + /* Special logic for atoms */ if (ea->type == ELT_ATOM && eb->type == ELT_ATOM && ea->priority == eb->priority) { @@ -495,8 +496,18 @@ rspamd_ast_priority_cmp (GNode *a, GNode *b) static gboolean rspamd_ast_resort_traverse (GNode *node, gpointer unused) { + GNode *children, *last; + if (node->children) { + + children = node->children; + last = g_node_last_sibling (children); + /* Needed for utlist compatibility */ + children->prev = last; DL_SORT (node->children, rspamd_ast_priority_cmp); + /* Restore GLIB compatibility */ + children = node->children; + children->prev = NULL; } return FALSE; |