From 4b93a743e83fb6e80547c7c1b139fe638d608fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 16 Feb 2016 10:02:44 +0000 Subject: [PATCH] Fixed an incorrect parsing of comments --- lib/c_tokenizer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/c_tokenizer.c b/lib/c_tokenizer.c index c25ad35187..c3f0551e46 100644 --- a/lib/c_tokenizer.c +++ b/lib/c_tokenizer.c @@ -268,12 +268,15 @@ char *mysql_query_digest_and_first_comment(char *s, int _len, char **first_comme if (*first_comment==NULL) { *first_comment=(char *)malloc(FIRST_COMMENT_MAX_LENGTH); } - *first_comment[fc_len]= !is_space_char(*s) ? *s : ' '; + char *c=*first_comment+fc_len; + *c = !is_space_char(*s) ? *s : ' '; fc_len++; } if (prev_char == '*' && *s == '/') { if (fc_len>=2) fc_len-=2; - *first_comment[fc_len]=0; + char *c=*first_comment+fc_len; + *c=0; + //*first_comment[fc_len]=0; fc=2; } }