changed handling of strings

This commit is contained in:
Walter Julius Hennecke 2013-10-10 21:42:02 +02:00
parent 216a871ff8
commit 0ed8422996

View file

@ -19,9 +19,7 @@ KEYWORD [a-zA-Z]+[a-zA-Z0-9]*
\"[^\"]*\" {
char *s = yytext; s++;
yyextra->type = LMT_STRING;
yyextra->data.str = malloc(strlen(yytext) - 1);
memset(yyextra->data.str, 0, strlen(yytext) - 1);
strncpy(yyextra->data.str, s, strlen(yytext) - 2);
yyextra->data.str = yytext;
yyextra->column += strlen(yytext);
return LMT_STRING;
}