Document and tweak json_load_callback()
Change the return value of json_load_callback_t to size_t, as it's feels more correct. The callback should return (size_t)-1 on failure. Issue #57.
This commit is contained in:
@@ -18,7 +18,7 @@ struct my_source {
|
||||
|
||||
static const char my_str[] = "[\"A\", {\"B\": \"C\", \"e\": false}, 1, null, \"foo\"]";
|
||||
|
||||
static int greedy_reader(void *buf, size_t buflen, void *arg)
|
||||
static size_t greedy_reader(void *buf, size_t buflen, void *arg)
|
||||
{
|
||||
struct my_source *s = arg;
|
||||
if (buflen > s->cap - s->off)
|
||||
|
||||
Reference in New Issue
Block a user