Revision: 2721
http://nagios.svn.sourceforge.net/nagios/?rev=2721&view=rev
Author: ageric
Date: 2013-04-07 15:37:56 +0000 (Sun, 07 Apr 2013)
Log Message:
-----------
lib/t-utils: Fix compiler warning about string literals
These actually need fixing, since test strings and names may well
contain format string characters, which would mean we'd get
garbage in the output. Let's avoid that, as noone likes garbage.
Signed-off-by: Andreas Ericsson <ae@...>
Modified Paths:
--------------
nagioscore/trunk/lib/t-utils.c
Modified: nagioscore/trunk/lib/t-utils.c
===================================================================
--- nagioscore/trunk/lib/t-utils.c 2013-04-07 15:37:37 UTC (rev 2720)
+++ nagioscore/trunk/lib/t-utils.c 2013-04-07 15:37:56 UTC (rev 2721)
@@ -127,11 +127,11 @@
int ok_int(int a, int b, const char *name)
{
if (a == b) {
- t_pass(name);
+ t_pass("%s", name);
return TEST_PASS;
}
- t_fail(name);
+ t_fail("%s", name);
t_diag("%d != %d. delta: %d", a, b, delta(a, b));
return TEST_FAIL;
}
@@ -139,11 +139,11 @@
int ok_uint(uint a, uint b, const char *name)
{
if (a == b) {
- t_pass(name);
+ t_pass("%s", name);
return TEST_PASS;
}
- t_fail(name);
+ t_fail("%s", name);
t_diag("%u != %u. delta: %u", a, b, delta(a, b));
return TEST_FAIL;
}
@@ -151,11 +151,11 @@
int ok_str(const char *a, const char *b, const char *name)
{
if ((!a && !b) || (a && b && !strcmp(a, b))) {
- t_pass(name);
+ t_pass("%s", name);
return TEST_PASS;
}
- t_fail(name);
+ t_fail("%s", name);
t_diag("'%s' != '%s'", a, b);
return TEST_FAIL;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|