yajl1 has the status yajl_status_insufficient_data, which in our stream
parsing context basically means "ok". Therefore, in yajl1, we no longer
print an error in this case.
}
if (!plaintext) {
yajl_status status = yajl_parse(parser, json_input, rec);
+#if YAJL_MAJOR >= 2
if (status != yajl_status_ok) {
- fprintf(stderr, "[i3bar] Could not parse JSON input: %.*s\n",
- rec, json_input);
+#else
+ if (status != yajl_status_ok && status != yajl_status_insufficient_data) {
+#endif
+ fprintf(stderr, "[i3bar] Could not parse JSON input (code %d): %.*s\n",
+ status, rec, json_input);
}
free(buffer);
} else {