lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201030090532.33af6a3f@hermes.local>
Date:   Fri, 30 Oct 2020 09:05:32 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Petr Machata <me@...chata.org>
Cc:     netdev@...r.kernel.org, dsahern@...il.com,
        john.fastabend@...il.com, jiri@...dia.com, idosch@...dia.com,
        Jakub Kicinski <kuba@...nel.org>,
        Roman Mashak <mrv@...atatu.com>
Subject: Re: [PATCH iproute2-next v2 03/11] lib: utils: Add
 print_on_off_bool()

On Fri, 30 Oct 2020 13:29:50 +0100
Petr Machata <me@...chata.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ