summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tikzit/src/common/tikzlexer.lm3
1 files changed, 2 insertions, 1 deletions
diff --git a/tikzit/src/common/tikzlexer.lm b/tikzit/src/common/tikzlexer.lm
index f0b6546..a9a2e51 100644
--- a/tikzit/src/common/tikzlexer.lm
+++ b/tikzit/src/common/tikzlexer.lm
@@ -39,7 +39,8 @@ extern int tokenpos;
%}
%%
%\n /* ignore end of line */;
-\n.* { strcpy(linebuff, yytext+1);
+\n.* { strncpy(linebuff, yytext+1, 500);
+ linebuff[499] = 0; // ensure null-terminated
lineno++;
tokenpos = 0;
yyless(1);