cesanta/frozen

Strange behaviour from jsonscanf

rabfulton opened this issue · 1 comments

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.

This is due to buf size is 32 in json_scanf_cb function.

Change the size or logic according to your need.