From 3abe16ecc2c04c9ec02dd2ec77e954e5ead5907b Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 21 Apr 2016 16:45:13 +1000 Subject: [PATCH] * f2b_cmd_parse() : fix strip of trailing blanks --- src/commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands.c b/src/commands.c index 50443b2..9442380 100644 --- a/src/commands.c +++ b/src/commands.c @@ -105,7 +105,7 @@ f2b_cmd_parse(const char *src, char *buf, size_t buflen) { src++; /* strip trailing spaces, newlines, etc */ strlcpy(line, src, sizeof(line)); - for (size_t l = strlen(line); l > 0 && isspace(line[l]); l--) + for (size_t l = strlen(line); l >= 1 && isspace(line[l - 1]); l--) line[l - 1] = '\0'; if (line[0] == '\0')