diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-18 15:21:17 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-18 15:21:17 -0400 |
commit | 99eab2d147acfe4e1e16b594023f08b4524bd3db (patch) | |
tree | 16c3944a131c26c9f80928f89aca6ceee729101a | |
parent | 12e22bb1b4a687def2f36f281456da28ee3a4d95 (diff) | |
download | roux-99eab2d147acfe4e1e16b594023f08b4524bd3db.tar.gz |
oops, nul terminate string tokens
-rw-r--r-- | lisc/parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } } |