diff options
Diffstat (limited to 'main2.c')
| -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: |
