From 3ebceeece2204d3755df1f1cc8210f7e97b6daad Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 16 Nov 2010 22:00:29 +0300 Subject: Make own strlcpy that does not calculate remaining string length (faster and more safe) Allow only ASCII symbols in logs, escape control chars --- src/statfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/statfile.c') diff --git a/src/statfile.c b/src/statfile.c index b26664fd5..cf8d12e3f 100644 --- a/src/statfile.c +++ b/src/statfile.c @@ -342,7 +342,7 @@ statfile_pool_open (statfile_pool_t * pool, gchar *filename, size_t size, gboole } - g_strlcpy (new_file->filename, filename, sizeof (new_file->filename)); + rspamd_strlcpy (new_file->filename, filename, sizeof (new_file->filename)); new_file->len = st.st_size; /* Aqquire lock for this operation */ lock_file (new_file->fd, FALSE); @@ -633,7 +633,7 @@ stat_file_t * statfile_pool_is_open (statfile_pool_t * pool, gchar *filename) { static stat_file_t f, *ret; - g_strlcpy (f.filename, filename, sizeof (f.filename)); + rspamd_strlcpy (f.filename, filename, sizeof (f.filename)); ret = lfind (&f, pool->files, (size_t *)&pool->opened, sizeof (stat_file_t), cmpstatfile); return ret; } -- cgit v1.2.3