Strange behaviour from jsonscanf
rabfulton opened this issue · 1 comments
rabfulton commented
Why do I get no output from this code?
`
char buf[200] = "";
const char *str = "{\"OrderUuid\":\"8dbf1ded-0ff5-421d-bc79-f3299375620\"}";
json_scanf(str, strlen(str), "{OrderUuid: %s}", buf);
printf("%s\n", buf);
`
If I remove the last 4 numbers from "8dbf1ded-0ff5-421d-bc79-f3299375620" it works as expected.
wahab80 commented
This is due to buf size is 32 in json_scanf_cb function.
Change the size or logic according to your need.