diff options
| author | Patrick | 2023-07-27 09:57:33 +0200 |
|---|---|---|
| committer | Patrick | 2023-07-27 09:57:33 +0200 |
| commit | b604b033f4cbdbb7b03f9a1c49e6744788438dd1 (patch) | |
| tree | 82195015f468689b74481395be274624657f372d /main2.c | |
| parent | 5ae0aff8511d9e55d25b35f2f9c3e2c70f5c6178 (diff) | |
| download | iftint-b604b033f4cbdbb7b03f9a1c49e6744788438dd1.tar.gz iftint-b604b033f4cbdbb7b03f9a1c49e6744788438dd1.zip | |
127 backspace
Diffstat (limited to 'main2.c')
| -rw-r--r-- | main2.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 +} |
