Skip to content

mjson_find return wrong result. #50

@oakfire

Description

@oakfire
    const char* j3 = "{\"a\":[],\"ab\":[{\"c1\":1,\"c2\":2},{\"c1\":3,\"c2\":4}]}";
    ASSERT(mjson_find(j3, strlen(j3), "$.a[0]", &p, &n) == MJSON_TOK_INVALID);  // this line FAIL!
    printf("mjson got: %d\n", mjson_find(j3, strlen(j3), "$.a[0]", &p, &n));  
    printf("got: %.*s\n", n, p); 

output:

mjson got 123
got: {"c1":1,"c2":2}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions