Commit 438f1609 authored by Philip Gladstone's avatar Philip Gladstone Committed by Marcel Stör
Browse files

Only handle errors if we have not parsed a complete object (#1999)

* Only handle errors if we have not parsed a complete object
* Fix typo which means that \n was not an ending character
parent 216b820d
...@@ -56,7 +56,9 @@ static int error_callback(jsonsl_t jsn, ...@@ -56,7 +56,9 @@ static int error_callback(jsonsl_t jsn,
char *at) char *at)
{ {
JSN_DATA *data = (JSN_DATA *) jsn->data; JSN_DATA *data = (JSN_DATA *) jsn->data;
if (!data->complete) {
data->error = jsonsl_strerror(err); data->error = jsonsl_strerror(err);
}
//fprintf(stderr, "Got error at pos %lu: %s\n", jsn->pos, jsonsl_strerror(err)); //fprintf(stderr, "Got error at pos %lu: %s\n", jsn->pos, jsonsl_strerror(err));
return 0; return 0;
......
...@@ -1484,7 +1484,7 @@ static const char Special_Endings[0x100] = { ...@@ -1484,7 +1484,7 @@ static const char Special_Endings[0x100] = {
/* 0xfe */ 0 /* 0xfe */ /* 0xfe */ 0 /* 0xfe */
}; };
static const uint32_t Special_Endings_bits[0x80 / 32] = { static const uint32_t Special_Endings_bits[0x80 / 32] = {
0b00000000110010000000000000000000, 0b00000000011001000000000000000000,
0b10100000000010000000000000100000, 0b10100000000010000000000000100000,
0b00000000000000000000000000011100, 0b00000000000000000000000000011100,
0b00000000000000000000000000010100 0b00000000000000000000000000010100
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment