aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/map.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-27 12:15:27 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-27 12:15:27 +0000
commit2aeb35054e5ed990dd795e0f688be893bf16e243 (patch)
tree9ad82681dc29542558276ded74c51d394d58b2ba /src/libutil/map.c
parenta7722d3554fa8f90c801a4781026fd799714991d (diff)
downloadrspamd-2aeb35054e5ed990dd795e0f688be893bf16e243.tar.gz
rspamd-2aeb35054e5ed990dd795e0f688be893bf16e243.zip
[Minor] Small improvements of key/value parsing of radix maps
Diffstat (limited to 'src/libutil/map.c')
-rw-r--r--src/libutil/map.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 72939aa7f..da99e384c 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -1723,14 +1723,17 @@ err:
*/
#define MAP_STORE_KEY do { \
+ while (g_ascii_isspace (*c) && p > c) { c ++; } \
key = g_malloc (p - c + 1); \
rspamd_strlcpy (key, c, p - c + 1); \
+ key = g_strchomp (key); \
} while (0)
#define MAP_STORE_VALUE do { \
+ while (g_ascii_isspace (*c) && p > c) { c ++; } \
value = g_malloc (p - c + 1); \
rspamd_strlcpy (value, c, p - c + 1); \
- value = g_strstrip (value); \
+ value = g_strchomp (value); \
} while (0)
gchar *
@@ -2067,7 +2070,7 @@ radix_tree_insert_helper (gpointer st, gconstpointer key, gconstpointer value)
{
radix_compressed_t *tree = (radix_compressed_t *)st;
- rspamd_radix_add_iplist ((gchar *)key, " ,;", tree, value, FALSE);
+ rspamd_radix_add_iplist ((gchar *)key, ",", tree, value, FALSE);
}
static void