]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix symbol type's check
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 22 Apr 2016 09:41:09 +0000 (10:41 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 22 Apr 2016 09:41:09 +0000 (10:41 +0100)
src/libserver/symbols_cache.c

index 717018e2503cefc71a2fa29683dd66201052156d..20c2a8ec01125e413b8543c75a2654662d53eace 100644 (file)
@@ -600,15 +600,15 @@ rspamd_symbols_cache_add_symbol (struct symbols_cache *cache,
 
        g_assert (cache != NULL);
 
-       if (name == NULL && type != SYMBOL_TYPE_CALLBACK) {
+       if (name == NULL && !(type & SYMBOL_TYPE_CALLBACK)) {
                msg_warn_cache ("no name for non-callback symbol!");
        }
-       else if (type == SYMBOL_TYPE_VIRTUAL && parent == -1) {
+       else if ((type & SYMBOL_TYPE_VIRTUAL) && parent == -1) {
                msg_warn_cache ("no parent symbol is associated with virtual symbol %s",
                        name);
        }
 
-       if (name != NULL && type != SYMBOL_TYPE_CALLBACK) {
+       if (name != NULL && !(type & SYMBOL_TYPE_CALLBACK)) {
                if (g_hash_table_lookup (cache->items_by_symbol, name) != NULL) {
                        msg_err_cache ("skip duplicate symbol registration for %s", name);
                        return -1;