From b604b033f4cbdbb7b03f9a1c49e6744788438dd1 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 27 Jul 2023 09:57:33 +0200 Subject: 127 backspace --- main2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main2.c') diff --git a/main2.c b/main2.c index 5864bc8..72a84d3 100644 --- a/main2.c +++ b/main2.c @@ -272,7 +272,7 @@ GetInt() { int result = 0; int c; while ((c = getch()), (c != '\r') && (c != '\n')) { - if (c == 8 && intStrLen > 0) { + if ((c == 8 || c == 127) && intStrLen > 0) { intStrLen--; intStr[intStrLen] = '\0'; result /= 10; @@ -295,7 +295,7 @@ GetStr() { int strLen = 0; int c; while ((c = getch()), (c != '\r') && (c != '\n')) { - if (c == 8 && strLen > 0) { + if ((c == 8 || c == 127) && strLen > 0) { strLen--; str[strLen] = '\0'; Draw(g_Node, str); @@ -364,7 +364,7 @@ GetNode(JSONNode * parent) { break; } case 8: - //case 127: + case 127: JSONNodePop(parent); Draw(g_Node, ""); result = GetNode(parent); @@ -417,4 +417,4 @@ int main() { // JSONFree(n); return 0; -} \ No newline at end of file +} -- cgit v1.2.3