diff options
| author | Patrick | 2023-08-02 23:47:20 +0200 |
|---|---|---|
| committer | Patrick | 2023-08-02 23:47:20 +0200 |
| commit | 4732c7322c4af189232d5faee94e43fe71b175d2 (patch) | |
| tree | 6ba8274edc14cb31a092f45dbb6e73dae3878c36 | |
| parent | b836e0a4630c9cf8c098b18bca83a3323e181b7f (diff) | |
| download | iftint-4732c7322c4af189232d5faee94e43fe71b175d2.tar.gz iftint-4732c7322c4af189232d5faee94e43fe71b175d2.zip | |
fix peekchar input
| -rw-r--r-- | main2.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -14,7 +14,7 @@ #define NEWARR(TYPE, NUM) ((TYPE *)calloc(NUM, sizeof(TYPE))) -// getch() +// getch #ifdef _WIN32 #include <windows.h> @@ -279,8 +279,8 @@ GetChar() { int PeekChar() { - int c = GetChar(); - ungetch(c); + Draw(); + int c = peekch(); return c; } @@ -354,20 +354,20 @@ GetNode(JSONNode * parent) { } case 'o': { result->kind = JSONNodeKind_Obj; - while ((c = peekch()), (c != '\r') && (c != '\n')) { + while ((c = PeekChar()), (c != '\r') && (c != '\n')) { JSONNodePush(result, JSONNodeNewStr(GetStr())); JSONNodePush(result, GetNode(result)); } - getch(); + GetChar(); break; } case 'a': { result->kind = JSONNodeKind_Arr; - while ((c = peekch()), (c != '\r') && (c != '\n')) { + while ((c = PeekChar()), (c != '\r') && (c != '\n')) { JSONNodePush(result, GetNode(result)); } - getch(); + GetChar(); break; } case 8: |
