Browse Source

Fix https://github.com/cesanta/frozen/issues/35

CL: Fix https://github.com/cesanta/frozen/issues/35

PUBLISHED_FROM=8cb9378aae1301369eed94fdfb2d16954951ba8d
Sergey Lyubka 7 years ago
parent
commit
dd8ec66939
1 changed files with 3 additions and 4 deletions
  1. 3 4
      README.md

+ 3 - 4
README.md

@@ -68,12 +68,11 @@ Example - scan arbitrary JSON string:
   // str has the following JSON string (notice keys are out of order):
   // { "a": 123, "d": true, "b": [1, 2], "c": "hi" }
 
-  int a, b;
-  char *c;
+  int a = 0, d = 0;
+  char *c = NULL;
   void *my_data = NULL;
   json_scanf(str, strlen(str), "{ a:%d, b:%M, c:%Q, d:%B }",
-             &a, scan_array, my_data, &c, &b);
-
+             &a, scan_array, my_data, &c, &d);
 
   // This function is called by json_scanf() call above.
   // str is "[1, 2]", user_data is my_data.