Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mjson_find return wrong result. #50

Open
oakfire opened this issue Aug 29, 2022 · 0 comments
Open

mjson_find return wrong result. #50

oakfire opened this issue Aug 29, 2022 · 0 comments

Comments

@oakfire
Copy link

oakfire commented Aug 29, 2022

    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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant