summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-18 15:21:17 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-18 15:21:17 -0400
commit99eab2d147acfe4e1e16b594023f08b4524bd3db (patch)
tree16c3944a131c26c9f80928f89aca6ceee729101a /lisc
parent12e22bb1b4a687def2f36f281456da28ee3a4d95 (diff)
downloadroux-99eab2d147acfe4e1e16b594023f08b4524bd3db.tar.gz
oops, nul terminate string tokens
Diffstat (limited to 'lisc')
-rw-r--r--lisc/parse.c6
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;
 		}
 	}