On Fri, 30 Oct 2020 13:29:50 +0100
Petr Machata <m...@pmachata.org> wrote:

> +void print_on_off_bool(FILE *fp, const char *flag, bool val)
> +{
> +     if (is_json_context())
> +             print_bool(PRINT_JSON, flag, NULL, val);
> +     else
> +             fprintf(fp, "%s %s ", flag, val ? "on" : "off");
> +}

Please use print_string(PRINT_FP for non json case.
I am use fprintf(fp as indicator for code that has not been already
converted to JSON.

And passing the FILE *fp is also indication of old code.
Original iproute2 passed it around but it was always stdout.

Reply via email to