From b3120aea25b78ebb2e025f8a4ffebbebf473a251 Mon Sep 17 00:00:00 2001 From: dbrotz <43593771+dbrotz@users.noreply.github.com> Date: Wed, 26 Jun 2019 17:45:49 -0700 Subject: [PATCH] Terminate standalone bracketed symbol strings Standalone bracketed symbols like the following weren't being zero-terminated. X EQUS {Y} This doesn't apply to bracketed symbols that aren't standalone, but are instead found in a string. For example, the following works even without this fix. X EQUS "{Y}" --- src/asm/lexer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/asm/lexer.c b/src/asm/lexer.c index c339bf49..17f0c92a 100644 --- a/src/asm/lexer.c +++ b/src/asm/lexer.c @@ -731,7 +731,9 @@ scanagain: return T_STRING; } else if (*pLexBuffer == '{') { pLexBuffer++; - yylex_ReadBracketedSymbol(yylval.tzString, 0); + size_t len = yylex_ReadBracketedSymbol(yylval.tzString, + 0); + yylval.tzString[len] = 0; return T_STRING; }