Subject: Re: [PATCH iproute2-next v2 03/11] lib: utils: Add print_on_off_bool()

From: Stephen Hemminger <[email-masked]>
Date: Fri, 30 Oct 2020 09:05:32 -0700

On Fri, 30 Oct 2020 13:29:50 +0100
Petr Machata <[email-masked]> 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.