summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Harley2022-05-11 12:15:52 +0100
committerTom Harley2022-05-11 12:15:52 +0100
commitac750f71abaa9f9faf5010a818a819b92862641f (patch)
tree85b7c1f0ce4471515e7447c886c6136e394bc40e
parentFix issue with nested case statements (diff)
downloadsinter-ac750f71abaa9f9faf5010a818a819b92862641f.tar.gz
sinter-ac750f71abaa9f9faf5010a818a819b92862641f.zip

Fix string parsing

Whoops! Strings were getting their last characters chopped off. No longer!

-rw-r--r--lex.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/lex.l b/lex.l
index 5546bad..a548576 100644
--- a/lex.l
+++ b/lex.l
@@ -34,7 +34,7 @@ char *str_value(char *s) {
s++;
/* FIXME: strdup allocates memory! */
char *ret = strdup(s);
- ret[strlen(s) - 2] = 0;
+ ret[strlen(s) - 1] = 0;
return ret;
}