From 2d588f5579993181b8e0326cdce4d0b4689b3260 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 17 Oct 2013 00:15:32 +0100 Subject: [PATCH] Fix float numbers parsing. --- src/rcl/rcl_parser.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rcl/rcl_parser.c b/src/rcl/rcl_parser.c index 0b69d25bc..7989ece15 100644 --- a/src/rcl/rcl_parser.c +++ b/src/rcl/rcl_parser.c @@ -250,6 +250,8 @@ rspamd_cl_lex_number (struct rspamd_cl_parser *parser, else { got_dot = TRUE; need_double = TRUE; + rspamd_cl_chunk_skipc (chunk, *p); + p ++; } } else if (*p == 'e' || *p == 'E') { @@ -265,10 +267,14 @@ rspamd_cl_lex_number (struct rspamd_cl_parser *parser, if (p >= chunk->end) { return FALSE; } - if (!g_ascii_isdigit (*p) && *p != '+' && *p == '-') { + if (!g_ascii_isdigit (*p) && *p != '+' && *p != '-') { /* Wrong exponent sign */ return FALSE; } + else { + rspamd_cl_chunk_skipc (chunk, *p); + p ++; + } } } else { -- 2.39.5