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
This commit is contained in:
Philip Gladstone 2017-06-18 02:20:26 -04:00 committed by Marcel Stör
parent 216b820d08
commit 438f1609f6
2 changed files with 4 additions and 2 deletions

View File

@ -56,7 +56,9 @@ static int error_callback(jsonsl_t jsn,
char *at)
{
JSN_DATA *data = (JSN_DATA *) jsn->data;
data->error = jsonsl_strerror(err);
if (!data->complete) {
data->error = jsonsl_strerror(err);
}
//fprintf(stderr, "Got error at pos %lu: %s\n", jsn->pos, jsonsl_strerror(err));
return 0;

View File

@ -1484,7 +1484,7 @@ static const char Special_Endings[0x100] = {
/* 0xfe */ 0 /* 0xfe */
};
static const uint32_t Special_Endings_bits[0x80 / 32] = {
0b00000000110010000000000000000000,
0b00000000011001000000000000000000,
0b10100000000010000000000000100000,
0b00000000000000000000000000011100,
0b00000000000000000000000000010100