[LTP] [Automated-testing] [PATCH v2 2/5] lib: Add minimalistic json parser
Petr Vorel
pvorel@suse.cz
Mon Mar 1 08:38:57 CET 2021
Hi Cyril,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Nice work!
> +static int eatws(struct tst_json_buf *buf)
> +{
> + while (!buf_empty(buf)) {
> + switch (buf->json[buf->off]) {
> + case ' ':
> + case '\t':
> + case '\n':
> + case '\f':
Shouldn't there be '\r' as well? (handled at copy_str()).
> + break;
> + default:
> + goto ret;
> + }
> +
> + buf->off += 1;
> + }
> +ret:
> + return buf_empty(buf);
> +}
Kind regards,
Petr
More information about the ltp
mailing list