return (rspamd_ftok_cmp (s, &srch) == 0);
}
+
+gchar *
+rspamd_ftokdup (const rspamd_ftok_t *src)
+{
+ gchar *newstr;
+
+ if (src == NULL) {
+ return NULL;
+ }
+
+ newstr = g_malloc (src->len + 1);
+ memcpy (newstr, src->begin, src->len);
+ newstr[src->len] = '\0';
+
+ return newstr;
+}
rspamd_fstring_t * rspamd_fstring_grow (rspamd_fstring_t *str,
gsize needed_len) G_GNUC_WARN_UNUSED_RESULT;
+/**
+ * Copies ftok to zero terminated string (must be freed using g_free)
+ * @param src
+ * @return
+ */
+gchar *rspamd_ftokdup (const rspamd_ftok_t *src) G_GNUC_WARN_UNUSED_RESULT;
+
+
#endif