[patch] Fix compiler warnings

Stephen Gran steve at lobefin.net
Thu Sep 23 22:22:30 CEST 2010


On Wed, Sep 22, 2010 at 09:19:18AM +0200, Michael Friedrich said:
> Hi,
> 
> Instead of adding another function doing pretty much the same, but
> without any variable arguments on the function call, you might have a
> look at Andreas Ericsson's patch by checking fmt for NULL, and
> replacing the string literal by NULL.
> 
> http://git.op5.org/git/?p=nagios.git;a=commit;h=bd8eb5927b2e2fe22b36601181d138acbba27e3a
> 
> It's nicely resolved and keeps the upstream clean for other NULL'ed
> arguments.

Hi,

Oh, I didn't notice that one when looking at this.  I thought about
doing something very similar (but mine used strlen instead of a NULL
check), but in the end I opted for a separate function because I prefer
to not abuse variadic functions with NULL input.  YMMV, of course - both
are valid, this is just my preference.

Cheers,
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | An optimist believes we live in the     |
|  steve at lobefin.net             | best world possible; a pessimist fears  |
|  http://www.lobefin.net/~steve | this is true.                           |
 --------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20100923/2029ba6a/attachment.sig>
-------------- next part --------------
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list