mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
oops, nul terminate string tokens
This commit is contained in:
parent
12e22bb1b4
commit
99eab2d147
@ -266,10 +266,12 @@ lex()
|
||||
tokval.str = vnew(0, 1);
|
||||
for (i=0;; i++) {
|
||||
c = fgetc(inf);
|
||||
if (c == '"')
|
||||
if (!i || tokval.str[i-1] != '\\')
|
||||
return TStr;
|
||||
vgrow(&tokval.str, i+1);
|
||||
if (c == '"')
|
||||
if (!i || tokval.str[i-1] != '\\') {
|
||||
tokval.str[i] = 0;
|
||||
return TStr;
|
||||
}
|
||||
tokval.str[i] = c;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user