]> source.dussan.org Git - rspamd.git/commitdiff
Fix float numbers parsing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 Oct 2013 23:15:32 +0000 (00:15 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 Oct 2013 23:15:32 +0000 (00:15 +0100)
src/rcl/rcl_parser.c

index 0b69d25bc71951ae92cd95a0d2c151065b972366..7989ece153516f157407501c2402ef86dbaa4589 100644 (file)
@@ -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 {