From d479b7c8ed1ce247d7c8beebe8870e24a151b357 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 14 Feb 2011 02:49:59 +0300 Subject: Fix bug with several metrics output. [1] Install surbl-whitelist. [1] [1] Reported by Victor Ustugov --- lib/librspamdclient.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/librspamdclient.c b/lib/librspamdclient.c index 2bc45c888..ef4518e51 100644 --- a/lib/librspamdclient.c +++ b/lib/librspamdclient.c @@ -258,16 +258,17 @@ parse_rspamd_metric_line (struct rspamd_connection *conn, guint len, GError **er struct rspamd_metric *new; p = b; - c = b; + + while (g_ascii_isspace (*p)) { + p ++; + } + c = p; + while (p - b < remain) { switch (state) { case 0: /* Read metric's name */ - if (g_ascii_isspace (*p)) { - state = 99; - next_state = 0; - } - else if (*p == ';') { + if (*p == ';') { if (p - c <= 1) { /* Empty metric name */ goto err; -- cgit v1.2.3