From 644e2af596b31a8396e1a01f6f74391368dfd32c Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Tue, 13 Nov 2018 23:42:04 -0600 Subject: [PATCH] Fixed a bug allowing the user to delete the shell prompt. --- src/shell.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shell.c b/src/shell.c index 13b1944..fa9a2d0 100644 --- a/src/shell.c +++ b/src/shell.c @@ -25,6 +25,11 @@ void key_pressed(unsigned char* character) } else { + if(strlen(commandbuffer) == 0) + { + //Do not delete the shell prompt, simply return. + return; + } //Otherwise clear the last character from the command //buffer. commandbuffer[len - 1] = '\0';