summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/xmlcode.l3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/xmlcode.l b/src/xmlcode.l
index 41f5504..65406d4 100644
--- a/src/xmlcode.l
+++ b/src/xmlcode.l
@@ -322,6 +322,7 @@ static void codifyLines(yyscan_t yyscanner,const char *text)
yyextra->yyLineNr++;
int l = (int)(p-sp-1);
char *tmp = (char*)malloc(l+1);
+ strncpy(tmp,sp,l);
tmp[l]='\0';
yyextra->code->codify(tmp);
free(tmp);
@@ -376,7 +377,7 @@ XMLCodeParser::XMLCodeParser() : p(std::make_unique<Private>())
{
xmlcodeYYlex_init_extra(&p->state,&p->yyscanner);
#ifdef FLEX_DEBUG
- xmlcodeYYset_debug(1,yyscanner);
+ xmlcodeYYset_debug(1,p->yyscanner);
#endif
resetCodeParserState();
}