aboutsummaryrefslogtreecommitdiffstats
path: root/src/symbols_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-11-16 22:00:29 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-11-16 22:00:29 +0300
commit3ebceeece2204d3755df1f1cc8210f7e97b6daad (patch)
tree38c122341dbbb2f1ea1a4c969ad95dda38c1106e /src/symbols_cache.c
parentc85dd608a568d61e3b24c55b715ad37ceedb7110 (diff)
downloadrspamd-3ebceeece2204d3755df1f1cc8210f7e97b6daad.tar.gz
rspamd-3ebceeece2204d3755df1f1cc8210f7e97b6daad.zip
Make own strlcpy that does not calculate remaining string length (faster and more safe)
Allow only ASCII symbols in logs, escape control chars
Diffstat (limited to 'src/symbols_cache.c')
-rw-r--r--src/symbols_cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/symbols_cache.c b/src/symbols_cache.c
index e82e83b87..d549218c2 100644
--- a/src/symbols_cache.c
+++ b/src/symbols_cache.c
@@ -267,7 +267,7 @@ register_symbol (struct symbols_cache **cache, const gchar *name, double weight,
item = memory_pool_alloc0 (pcache->static_pool, sizeof (struct cache_item));
item->s = memory_pool_alloc0 (pcache->static_pool, sizeof (struct saved_cache_item));
- g_strlcpy (item->s->symbol, name, sizeof (item->s->symbol));
+ rspamd_strlcpy (item->s->symbol, name, sizeof (item->s->symbol));
item->func = func;
item->user_data = user_data;
@@ -306,7 +306,7 @@ register_dynamic_symbol (memory_pool_t *dynamic_pool, struct symbols_cache **cac
item = memory_pool_alloc0 (dynamic_pool, sizeof (struct cache_item));
item->s = memory_pool_alloc (dynamic_pool, sizeof (struct saved_cache_item));
- g_strlcpy (item->s->symbol, name, sizeof (item->s->symbol));
+ rspamd_strlcpy (item->s->symbol, name, sizeof (item->s->symbol));
item->func = func;
item->user_data = user_data;
/* Handle weight using default metric */