Re: [PATCH v2] vsprintf: automatic parameters for %pIS via 'a'

From: Joe Perches
Date: Wed Feb 03 2016 - 18:37:22 EST


On Thu, 2016-02-04 at 00:29 +0100, Jason A. Donenfeld wrote:
> This patch adds a variable 'a' which indicates that the 'p',
> 'f', and 's' options should be toggled on or off depending on
> whether or not those parameters are actually valid inside the
> passed sockaddr.

trivia:

> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
[]
> @@ -1225,9 +1234,15 @@ char *ip4_addr_string_sa(char *buf, char *end, const struct sockaddr_in *sa,
[]
> + if (have_a)
> + have_p = sa->sin_port != 0;
> +

different style than the v6 tests