From 99eab2d147acfe4e1e16b594023f08b4524bd3db Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 18 Mar 2016 15:21:17 -0400 Subject: oops, nul terminate string tokens --- lisc/parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisc') diff --git a/lisc/parse.c b/lisc/parse.c index bf509d1..7053ba5 100644 --- a/lisc/parse.c +++ b/lisc/parse.c @@ -266,10 +266,12 @@ lex() tokval.str = vnew(0, 1); for (i=0;; i++) { c = fgetc(inf); + vgrow(&tokval.str, i+1); if (c == '"') - if (!i || tokval.str[i-1] != '\\') + if (!i || tokval.str[i-1] != '\\') { + tokval.str[i] = 0; return TStr; - vgrow(&tokval.str, i+1); + } tokval.str[i] = c; } } -- cgit 1.4.1