Fixes following deficiencies:
* unhandled read() errors
* everything bundled in one long function, which is hard to follow and
reason about
* JSON parser errors are being ignored, anything else then
json_tokener_continue is fatal error
* JSON parser errors are being output to stderr, thu
On 1/3/20 1:46 AM, Petr Štetiar wrote:
> Fixes following deficiencies:
>
> * unhandled read() errors
> * everything bundled in one long function, which is hard to follow and
>reason about
> * JSON parser errors are being ignored, anything else then
>json_tokener_continue is fatal error
Hauke Mehrtens [2020-01-04 20:41:44]:
Hi,
thanks for the review!
> Please annotate the function with:
> __attribute__ ((format (printf, 2, 3)));
Done.
> > + va_start(va, fmt);
> > + r = vsnprintf(buf+r, sizeof(buf)-r, fmt, va);
>
> Please check here for truncation:
>
> rv = vsnprintf(buf+
On 1/5/20 11:40 AM, Petr Štetiar wrote:
> Hauke Mehrtens [2020-01-04 20:41:44]:
>
> Hi,
>
> thanks for the review!
>
>> Please annotate the function with:
>> __attribute__ ((format (printf, 2, 3)));
>
> Done.
>
>>> + va_start(va, fmt);
>>> + r = vsnprintf(buf+r, sizeof(buf)-r, fmt, va);
>
Hauke Mehrtens [2020-01-04 20:41:44]:
> > + vjson_error(err, "unhandled error");
>
> In which case is this returned, aren't there specific error handlers in
> call cases now and vjson_parse() would overwrite it again?
It should be returned in unhandled cases, in case I've missed to handle
some