diff options
Diffstat (limited to 'src/commands.c')
-rw-r--r-- | src/commands.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/commands.c b/src/commands.c index 8cb81de..24d6c0d 100644 --- a/src/commands.c +++ b/src/commands.c @@ -23,8 +23,7 @@ int commands(buffer *b, struct commands *c) ++cmd.len; } - if (cmd.len > 0) - if (cmd.s[cmd.len - 1] == '\r') --cmd.len; + if (cmd.len > 0 && cmd.s[cmd.len - 1] == '\r') --cmd.len; cmd.s[cmd.len] = 0; |