summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-03-15 12:43:12 -0400
committerJakob Kaivo <jkk@ung.org>2019-03-15 12:43:12 -0400
commit675bd05f0e57e54e00425a4f342a1c4103a08212 (patch)
tree3c2737bcd106734ccdf4f9ec06f42b20b9f46213 /parse.c
parent4f02abda506190ca020f7758a2177aa6c5035c64 (diff)
fix off-by-one on trailing whitespace trimmer
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 39b3502..61e41ee 100644
--- a/parse.c
+++ b/parse.c
@@ -65,7 +65,7 @@ struct command *sh_parse(const char *cmdline)
start++;
}
- char *end = l + strlen(l);
+ char *end = l + strlen(l) - 1;
while (isspace(*end) && end > start) {
*end = '\0';
end--;