aboutsummaryrefslogtreecommitdiffstats
path: root/src/fstring.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-01-19 17:01:08 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-01-19 17:01:08 +0300
commit87c9659fdd08bbbc0eb796afccf7237a03181498 (patch)
tree9d18d2064ac00b566c48eda1c1b58a31f8c7dd72 /src/fstring.c
parentfe5ad5874aad220fb12a259e607f89ce5fae7465 (diff)
downloadrspamd-87c9659fdd08bbbc0eb796afccf7237a03181498.tar.gz
rspamd-87c9659fdd08bbbc0eb796afccf7237a03181498.zip
* Rewrite perl client for rspamd, now it allows access to both normal and control interfaces
* Fix small errors in tokenizer and controller interface
Diffstat (limited to 'src/fstring.c')
-rw-r--r--src/fstring.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/fstring.c b/src/fstring.c
index 2935fe8e6..b2008c047 100644
--- a/src/fstring.c
+++ b/src/fstring.c
@@ -1,4 +1,5 @@
#include <stdlib.h>
+#include <string.h>
#include "fstring.h"
@@ -155,6 +156,21 @@ fstrcat (f_str_t *dest, f_str_t *src)
}
/*
+ * Make copy of string to 0-terminated string
+ */
+char*
+fstrcstr (f_str_t *str, memory_pool_t *pool)
+{
+ char *res;
+ res = memory_pool_alloc (pool, str->len + 1);
+
+ memcpy (res, str->begin, str->len);
+ res[str->len] = 0;
+
+ return res;
+}
+
+/*
* Push one character to fstr
*/
int