From 675bd05f0e57e54e00425a4f342a1c4103a08212 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 15 Mar 2019 12:43:12 -0400 Subject: fix off-by-one on trailing whitespace trimmer --- parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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--; -- cgit v1.2.1