[quagga-dev 8848] Re: [PATCH 6/9] vty: fix warnings

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Wed Sep 14 16:23:08 BST 2011


On Wed, Sep 14, 2011 at 04:21:07PM +0200, David Lamparter wrote:
> On Tue, Sep 13, 2011 at 05:45:32PM +0400, Denis Ovsienko wrote:
> > 31.08.2011, 19:31, "David Lamparter" <equinox at diac24.net>:
> > > From: Stephen Hemminger <shemminger at vyatta.com>
> > >
> > > Gcc now warns if function that takes printf style formatting is
> > > passed a non-constant string. This avoid issues when a format character
> > > is entered in some command.
> > 
> > My GCCs produce no warnings for lib/command.c, is this the right patch for the problem? 
> 
> I primarily merged it to my tree because
> +  message = argv_concat(argv, argc, 1);
> +  zlog(NULL, level, "%s", message ? message : "");
> is easier to read than
> -  zlog(NULL, level, "%s", ((message = argv_concat(argv, argc, 1)) ?  message : ""));
> 
> It's not like we pay money per byte or something...
> 
> The commit message is a bit misleading though, the behaviour of
> the code doesn't change with regards to format characters in input.
> Maybe the patch was different originally and it was altered in some
> rebase :/

Thank you for removing a piece of ugly evil coding (that C unfortunately
allows).

-- 
Len Sorensen



More information about the Quagga-dev mailing list