rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (struct rspamd_composite));
composite->expr = expr;
composite->id = g_hash_table_size (cfg->composite_symbols);
- g_hash_table_insert (cfg->composite_symbols,
- (gpointer)composite_name,
- composite);
-
- if (new) {
- rspamd_symbols_cache_add_symbol (cfg->cache, composite_name, 0,
- NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
- }
val = ucl_object_lookup (obj, "score");
if (val != NULL && ucl_object_todouble_safe (val, &score)) {
}
}
+ g_hash_table_insert (cfg->composite_symbols,
+ (gpointer)composite_name,
+ composite);
+
+ if (new) {
+ rspamd_symbols_cache_add_symbol (cfg->cache, composite_name, 0,
+ NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
+ }
+
return TRUE;
}
/* Strip spaces from the url */
/* Head spaces */
- while (g_ascii_isspace (*p) && p < start + len) {
+ while ( p < start + len && g_ascii_isspace (*p)) {
p ++;
start ++;
len --;
/* Trailing spaces */
p = start + len - 1;
- while (g_ascii_isspace (*p) && p >= start) {
+ while (p >= start && g_ascii_isspace (*p)) {
p --;
len --;