]> gitweb.ps.run Git - iftint/commitdiff
PeekChar -> peeckh (?)
authorPatrick <patrick.schoenberger@posteo.de>
Fri, 28 Jul 2023 09:32:52 +0000 (11:32 +0200)
committerPatrick <patrick.schoenberger@posteo.de>
Fri, 28 Jul 2023 09:32:52 +0000 (11:32 +0200)
main2.c

diff --git a/main2.c b/main2.c
index 12f99d4f5daaf8d5ae6e27fd43c78822158ab214..51c5ad4975c359f22dddb65beb005f4edc178ff1 100644 (file)
--- a/main2.c
+++ b/main2.c
@@ -297,6 +297,7 @@ PeekChar() {
 int
 GetInt() {
     static char intStr[16];
+    intStr[0] = '\0';
     int intStrLen = 0;
     int result = 0;
     int c;
@@ -363,20 +364,20 @@ GetNode(JSONNode * parent) {
     }
     case 'o': {
         result->kind = JSONNodeKind_Obj;
-        while ((c = PeekChar()), (c != '\r') && (c != '\n')) {
+        while ((c = peekch()), (c != '\r') && (c != '\n')) {
             JSONNodePush(result, JSONNodeNewStr(GetStr()));
 
             JSONNodePush(result, GetNode(result));
         }
-        GetChar();
+        getch();
         break;
     }
     case 'a': {
         result->kind = JSONNodeKind_Arr;
-        while ((c = PeekChar()), (c != '\r') && (c != '\n')) {
+        while ((c = peekch()), (c != '\r') && (c != '\n')) {
             JSONNodePush(result, GetNode(result));
         }
-        GetChar();
+        getch();
         break;
     }
     case 8: