From 98ef56b2b103b07f7678cc47cd0ccbb0a48c5616 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 16 Dec 2016 17:56:32 +0000 Subject: [PATCH] [Minor] Add macro to make ftok_t from string literal --- src/libutil/fstring.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libutil/fstring.h b/src/libutil/fstring.h index e23bd5e19..c1b205817 100644 --- a/src/libutil/fstring.h +++ b/src/libutil/fstring.h @@ -177,4 +177,6 @@ gchar *rspamd_ftokdup (const rspamd_ftok_t *src) G_GNUC_WARN_UNUSED_RESULT; * @return */ gchar *rspamd_fstringdup (const rspamd_fstring_t *src) G_GNUC_WARN_UNUSED_RESULT; + +#define RSPAMD_FTOK_ASSIGN(t, lit) do { (t)->begin = (lit); (t)->len = sizeof(lit) - 1; } while (0) #endif -- 2.39.5