Meh, personal taste. Also the idea is to keep AF switches to a minimum
and use them as an indication that something important is going on.
I'd rather just read over the memset as something boring.

Maybe we are even lucky and compilers are smart enough to figure this
out on their own?

On Tue, Jun 13, 2017 at 07:51:00PM +0200, Klemens Nanni wrote:
> Do not clear the unneeded dst[46] structure.
> 
> Index: ping.c
> ===================================================================
> RCS file: /cvs/src/sbin/ping/ping.c,v
> retrieving revision 1.218
> diff -u -p -r1.218 ping.c
> --- ping.c    22 Feb 2017 13:43:35 -0000      1.218
> +++ ping.c    13 Jun 2017 17:32:13 -0000
> @@ -434,8 +434,10 @@ main(int argc, char *argv[])
>       if (argc != 1)
>               usage();
> 
> -     memset(&dst4, 0, sizeof(dst4));
> -     memset(&dst6, 0, sizeof(dst6));
> +     if (v6flag)
> +             memset(&dst6, 0, sizeof(dst6));
> +     else
> +             memset(&dst4, 0, sizeof(dst4));
> 
>       target = *argv;
> 
> 

-- 
I'm not entirely sure you are real.

Reply via email to