]> 4ch.mooo.com Git - 16.git/commitdiff
modified: src/lib/jsmn/example/MAPTEST.EXE
authorsparky4 <sparky4@cock.li>
Sun, 22 Mar 2015 23:47:54 +0000 (18:47 -0500)
committersparky4 <sparky4@cock.li>
Sun, 22 Mar 2015 23:47:54 +0000 (18:47 -0500)
modified:   src/lib/jsmn/example/maptest.c

src/lib/jsmn/example/MAPTEST.EXE
src/lib/jsmn/example/maptest.c

index 4c74586aa520ba1aed4c0da52688d3255ef7a19f..a01c1d5c12557e3cc9b701468c3065e048d269bc 100644 (file)
Binary files a/src/lib/jsmn/example/MAPTEST.EXE and b/src/lib/jsmn/example/MAPTEST.EXE differ
index 9c5b11d74b92b9f689009734ff2fa933a72859e4..606a604e995c03a54d2c12f42aba6722cd7dd718 100644 (file)
@@ -34,6 +34,7 @@ static int jsoneq(const char *json, jsmntok_t *tok, const char *s) {
 int main() {
        int i;
        int r;
+       size_t z;
        //char json_s[8192];
        jsmn_parser p;
        jsmntok_t t[2048]; /* We expect no more than 128 tokens */
@@ -44,8 +45,9 @@ int main() {
 
        if(fh != NULL)
        {
-               fread(json_string, 1, filesize(fh), fh);
-               json_string+1="\0";
+               z = fread(json_string, 1, filesize(fh), fh);
+               printf("[[%d]]\n", z);
+               json_string[z] = '\0';
                // we can now close the file
                //printf("]%s[\n", json_s);
                //json_string=json_s;