From: Vsevolod Stakhov Date: Wed, 16 Oct 2013 23:15:32 +0000 (+0100) Subject: Fix float numbers parsing. X-Git-Tag: 0.6.0~118 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2d588f5579993181b8e0326cdce4d0b4689b3260;p=rspamd.git Fix float numbers parsing. --- 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 {