From 52c2c0649de6cc9bbf4091be45ec13a9846662be Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 29 Sep 2012 13:45:54 +0200 Subject: [PATCH] backspace handling: do nothing when at the left-most position --- src/general.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/general.c b/src/general.c index d40627e..0e50a72 100644 --- a/src/general.c +++ b/src/general.c @@ -33,6 +33,9 @@ char *get_input() { break; /* backspace? */ if (c == 20) { + /* If you are at the left-most position, do nothing */ + if (i == 0) + continue; output[--i] = '\0'; cputcxy(x+i, y, ' '); gotoxy(x+i, y); -- 2.39.5