summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/common_logging.c2
-rw-r--r--src/util/configuration.c6
-rw-r--r--src/util/crypto_random.c2
-rw-r--r--src/util/getopt.c28
-rw-r--r--src/util/getopt_helpers.c4
-rw-r--r--src/util/plugin.c2
-rw-r--r--src/util/test_common_allocation.c2
-rw-r--r--src/util/test_common_logging.c8
-rw-r--r--src/util/test_common_logging_dummy.c2
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c6
-rw-r--r--src/util/test_configuration.c12
-rw-r--r--src/util/test_crypto_aes_weak.c2
-rw-r--r--src/util/test_crypto_ksk.c30
-rw-r--r--src/util/test_crypto_random.c2
-rw-r--r--src/util/test_crypto_rsa.c34
-rw-r--r--src/util/test_disk.c10
-rw-r--r--src/util/test_os_start_process.c4
-rw-r--r--src/util/test_peer.c4
-rw-r--r--src/util/test_resolver_api.c6
-rw-r--r--src/util/test_scheduler_delay.c12
-rw-r--r--src/util/test_service.c2
-rw-r--r--src/util/test_strings.c2
22 files changed, 91 insertions, 91 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index c358e6fd8..72a2c67da 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -680,7 +680,7 @@ output_message (enum GNUNET_ErrorType kind, const char *comp,
if (GNUNET_stderr != NULL)
{
- fprintf (GNUNET_stderr, "%s %s %s %s", datestr, comp,
+ FPRINTF (GNUNET_stderr, "%s %s %s %s", datestr, comp,
GNUNET_error_type_to_string (kind), msg);
fflush (GNUNET_stderr);
}
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 41a4e1975..eb86d0496 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -309,7 +309,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
sec = cfg->sections;
while (sec != NULL)
{
- if (0 > fprintf (fp, "[%s]\n", sec->name))
+ if (0 > FPRINTF (fp, "[%s]\n", sec->name))
{
error = 1;
break;
@@ -327,7 +327,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
pos[0] = '\\';
pos[1] = 'n';
}
- if (0 > fprintf (fp, "%s = %s\n", ent->key, val))
+ if (0 > FPRINTF (fp, "%s = %s\n", ent->key, val))
{
error = 1;
GNUNET_free (val);
@@ -339,7 +339,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
}
if (error != 0)
break;
- if (0 > fprintf (fp, "\n"))
+ if (0 > FPRINTF (fp, "%s\n", ""))
{
error = 1;
break;
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index ff20646f7..121dbef9a 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -303,7 +303,7 @@ void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init ()
gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
if (!gcry_check_version (GCRYPT_VERSION))
{
- fprintf (stderr,
+ FPRINTF (stderr,
_
("libgcrypt has not the expected version (version %s is required).\n"),
GCRYPT_VERSION);
diff --git a/src/util/getopt.c b/src/util/getopt.c
index 08c133423..169949821 100644
--- a/src/util/getopt.c
+++ b/src/util/getopt.c
@@ -669,7 +669,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
if (ambig && !exact)
{
if (GNopterr)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0],
+ FPRINTF (stderr, _("%s: option `%s' is ambiguous\n"), argv[0],
argv[GNoptind]);
nextchar += strlen (nextchar);
GNoptind++;
@@ -692,12 +692,12 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
{
if (argv[GNoptind - 1][1] == '-')
/* --option */
- fprintf (stderr,
+ FPRINTF (stderr,
_("%s: option `--%s' does not allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
- fprintf (stderr,
+ FPRINTF (stderr,
_("%s: option `%c%s' does not allow an argument\n"),
argv[0], argv[GNoptind - 1][0], pfound->name);
}
@@ -715,7 +715,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
{
if (GNopterr)
{
- fprintf (stderr, _("%s: option `%s' requires an argument\n"),
+ FPRINTF (stderr, _("%s: option `%s' requires an argument\n"),
argv[0], argv[GNoptind - 1]);
}
nextchar += strlen (nextchar);
@@ -744,11 +744,11 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
{
if (argv[GNoptind][1] == '-')
/* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0],
+ FPRINTF (stderr, _("%s: unrecognized option `--%s'\n"), argv[0],
nextchar);
else
/* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0],
+ FPRINTF (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0],
argv[GNoptind][0], nextchar);
}
nextchar = (char *) "";
@@ -773,9 +773,9 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
{
if (posixly_correct)
/* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
+ FPRINTF (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
else
- fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
+ FPRINTF (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
}
return '?';
}
@@ -803,7 +803,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
if (GNopterr)
{
/* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+ FPRINTF (stderr, _("%s: option requires an argument -- %c\n"),
argv[0], c);
}
if (optstring[0] == ':')
@@ -851,7 +851,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
if (ambig && !exact)
{
if (GNopterr)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0],
+ FPRINTF (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0],
argv[GNoptind]);
nextchar += strlen (nextchar);
GNoptind++;
@@ -869,7 +869,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
else
{
if (GNopterr)
- fprintf (stderr, _("\
+ FPRINTF (stderr, _("\
%s: option `-W %s' does not allow an argument\n"), argv[0], pfound->name);
nextchar += strlen (nextchar);
@@ -883,7 +883,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
else
{
if (GNopterr)
- fprintf (stderr, _("%s: option `%s' requires an argument\n"),
+ FPRINTF (stderr, _("%s: option `%s' requires an argument\n"),
argv[0], argv[GNoptind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
@@ -931,7 +931,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
if (GNopterr)
{
/* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+ FPRINTF (stderr, _("%s: option requires an argument -- %c\n"),
argv[0], c);
}
if (optstring[0] == ':')
@@ -1035,7 +1035,7 @@ GNUNET_GETOPT_run (const char *binaryOptions,
}
if (i == count)
{
- fprintf (stderr, _("Use --help to get a list of options.\n"));
+ FPRINTF (stderr, _("Use %s to get a list of options.\n"), "--help");
cont = GNUNET_SYSERR;
}
}
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c
index c74b90877..8fb3673c0 100644
--- a/src/util/getopt_helpers.c
+++ b/src/util/getopt_helpers.c
@@ -252,7 +252,7 @@ GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
if (1 != SSCANF (value, "%llu", val))
{
- fprintf (stderr, _("You must pass a number to the `%s' option.\n"), option);
+ FPRINTF (stderr, _("You must pass a number to the `%s' option.\n"), option);
return GNUNET_SYSERR;
}
return GNUNET_OK;
@@ -280,7 +280,7 @@ GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
if (1 != SSCANF (value, "%u", val))
{
- fprintf (stderr, _("You must pass a number to the `%s' option.\n"), option);
+ FPRINTF (stderr, _("You must pass a number to the `%s' option.\n"), option);
return GNUNET_SYSERR;
}
return GNUNET_OK;
diff --git a/src/util/plugin.c b/src/util/plugin.c
index fe5fb87f9..4e0385a09 100644
--- a/src/util/plugin.c
+++ b/src/util/plugin.c
@@ -86,7 +86,7 @@ plugin_init ()
err = lt_dlinit ();
if (err > 0)
{
- fprintf (stderr, _("Initialization of plugin mechanism failed: %s!\n"),
+ FPRINTF (stderr, _("Initialization of plugin mechanism failed: %s!\n"),
lt_dlerror ());
return;
}
diff --git a/src/util/test_common_allocation.c b/src/util/test_common_allocation.c
index 950f0cedb..438d39751 100644
--- a/src/util/test_common_allocation.c
+++ b/src/util/test_common_allocation.c
@@ -105,7 +105,7 @@ main (int argc, char *argv[])
GNUNET_log_setup ("test-common-allocation", "WARNING", NULL);
ret = check ();
if (ret != 0)
- fprintf (stderr, "ERROR %d.\n", ret);
+ FPRINTF (stderr, "ERROR %d.\n", ret);
return ret;
}
diff --git a/src/util/test_common_logging.c b/src/util/test_common_logging.c
index d057db099..934586926 100644
--- a/src/util/test_common_logging.c
+++ b/src/util/test_common_logging.c
@@ -44,7 +44,7 @@ main (int argc, char *argv[])
unsigned int logs = 0;
if (0 != putenv ("GNUNET_FORCE_LOG="))
- fprintf (stderr, "Failed to putenv: %s\n", strerror (errno));
+ FPRINTF (stderr, "Failed to putenv: %s\n", strerror (errno));
GNUNET_log_setup ("test-common-logging", "DEBUG", "/dev/null");
GNUNET_logger_add (&my_log, &logs);
GNUNET_logger_add (&my_log, &logs);
@@ -60,7 +60,7 @@ main (int argc, char *argv[])
GNUNET_logger_remove (&my_log, &logs);
if (logs != 4)
{
- fprintf (stdout, "Expected 4 log calls, got %u\n", logs);
+ FPRINTF (stdout, "Expected 4 log calls, got %u\n", logs);
failureCount++;
}
GNUNET_break (0 ==
@@ -84,13 +84,13 @@ main (int argc, char *argv[])
GNUNET_logger_remove (&my_log, &logs);
if (logs != 1)
{
- fprintf (stdout, "Expected 1 log call, got %u\n", logs);
+ FPRINTF (stdout, "Expected 1 log call, got %u\n", logs);
failureCount++;
}
if (failureCount != 0)
{
- fprintf (stdout, "%u TESTS FAILED!\n", failureCount);
+ FPRINTF (stdout, "%u TESTS FAILED!\n", failureCount);
return -1;
}
return 0;
diff --git a/src/util/test_common_logging_dummy.c b/src/util/test_common_logging_dummy.c
index 005b5caef..9f6756ff4 100644
--- a/src/util/test_common_logging_dummy.c
+++ b/src/util/test_common_logging_dummy.c
@@ -37,7 +37,7 @@ my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component,
{
if (strncmp ("test-common-logging-dummy", component, 25) != 0)
return;
- fprintf (stdout, "%s", msg);
+ FPRINTF (stdout, "%s", msg);
fflush (stdout);
}
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index 9b5b1228a..51123d9b3 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -171,7 +171,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
buf_ptr += rd;
bytes += rd;
#if VERBOSE
- fprintf (stderr, "got %d bytes, reading more\n", rd);
+ FPRINTF (stderr, "got %d bytes, reading more\n", rd);
#endif
GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
stdout_read_handle, &read_call,
@@ -180,7 +180,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
#if VERBOSE
- fprintf (stderr, "bytes is %d:%s\n", bytes, buf);
+ FPRINTF (stderr, "bytes is %d:%s\n", bytes, buf);
#endif
/* +------CHILD OUTPUT--
@@ -251,7 +251,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
&delays[7], level)))
{
if (bytes == 20 * 16)
- fprintf (stderr, "Ran out of buffer space!\n");
+ FPRINTF (stderr, "%s", "Ran out of buffer space!\n");
GNUNET_break (0);
ok = 2;
GNUNET_SCHEDULER_cancel (die_task);
diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c
index 3780b3649..b1a446f86 100644
--- a/src/util/test_configuration.c
+++ b/src/util/test_configuration.c
@@ -240,14 +240,14 @@ checkDiffs (struct GNUNET_CONFIGURATION_Handle *cfgDefault, int option)
GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &cbData);
if (1 == (ret = cbData.status))
{
- fprintf (stderr,
+ FPRINTF (stderr, "%s",
"Incorrect Configuration Diffs: Diffs may contain data not actually edited\n");
goto housekeeping;
}
cbData.cfgDiffs = cfg;
GNUNET_CONFIGURATION_iterate (cfgDiffs, diffsCallBack, &cbData);
if ((ret = cbData.status) == 1)
- fprintf (stderr,
+ FPRINTF (stderr, "%s",
"Incorrect Configuration Diffs: Data may be missing in diffs\n");
housekeeping:
@@ -277,7 +277,7 @@ testConfig ()
return 1;
if (0 != strcmp ("b", c))
{
- fprintf (stderr, "Got `%s'\n", c);
+ FPRINTF (stderr, "Got `%s'\n", c);
GNUNET_free (c);
return 2;
}
@@ -470,7 +470,7 @@ main (int argc, char *argv[])
if (GNUNET_OK !=
GNUNET_CONFIGURATION_parse (cfg, "test_configuration_data.conf"))
{
- fprintf (stderr, "Failed to parse configuration file\n");
+ FPRINTF (stderr, "%s", "Failed to parse configuration file\n");
GNUNET_CONFIGURATION_destroy (cfg);
return 1;
}
@@ -484,7 +484,7 @@ main (int argc, char *argv[])
if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, "/tmp/gnunet-test.conf"))
{
- fprintf (stderr, "Failed to write configuration file\n");
+ FPRINTF (stderr, "%s", "Failed to write configuration file\n");
GNUNET_CONFIGURATION_destroy (cfg);
return 1;
}
@@ -546,7 +546,7 @@ main (int argc, char *argv[])
error:
if (failureCount != 0)
{
- fprintf (stderr, "Test failed: %u\n", failureCount);
+ FPRINTF (stderr, "Test failed: %u\n", failureCount);
return 1;
}
return 0;
diff --git a/src/util/test_crypto_aes_weak.c b/src/util/test_crypto_aes_weak.c
index a0161b575..0b7ba5c54 100644
--- a/src/util/test_crypto_aes_weak.c
+++ b/src/util/test_crypto_aes_weak.c
@@ -136,7 +136,7 @@ getWeakKeys ()
{
if (number_of_runs % 1000 == 0)
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
/*printf("Got to run number %d.\n", number_of_runs); */
GNUNET_CRYPTO_aes_create_session_key (&sessionkey);
diff --git a/src/util/test_crypto_ksk.c b/src/util/test_crypto_ksk.c
index 2789f5edb..58c459547 100644
--- a/src/util/test_crypto_ksk.c
+++ b/src/util/test_crypto_ksk.c
@@ -46,7 +46,7 @@ testCorrectKey ()
int i;
char out[3];
- fprintf (stderr, "Testing KBlock key correctness");
+ FPRINTF (stderr, "%s", "Testing KBlock key correctness");
GNUNET_CRYPTO_hash ("X", strlen ("X"), &in);
hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
if (hostkey == NULL)
@@ -66,12 +66,12 @@ testCorrectKey ()
snprintf (out, sizeof (out), "%02x", ((unsigned char *) &pkey)[i]);
if (0 != strncmp (out, &want[i * 2], 2))
{
- fprintf (stderr, " Failed! Wanted %.2s but got %2s at %d\n", &want[i * 2],
+ FPRINTF (stderr, " Failed! Wanted %.2s but got %2s at %d\n", &want[i * 2],
out, i);
return GNUNET_SYSERR;
}
}
- fprintf (stderr, " OK\n");
+ FPRINTF (stderr, "%s", " OK\n");
return GNUNET_OK;
}
@@ -85,7 +85,7 @@ testMultiKey (const char *word)
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey1;
int i;
- fprintf (stderr, "Testing KBlock key uniqueness (%s) ", word);
+ FPRINTF (stderr, "Testing KBlock key uniqueness (%s) ", word);
GNUNET_CRYPTO_hash (word, strlen (word), &in);
hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
if (hostkey == NULL)
@@ -101,12 +101,12 @@ testMultiKey (const char *word)
GNUNET_CRYPTO_rsa_key_free (hostkey);
for (i = 0; i < UNIQUE_ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
if (hostkey == NULL)
{
GNUNET_break (0);
- fprintf (stderr, " ERROR\n");
+ FPRINTF (stderr, "%s", " ERROR\n");
return GNUNET_SYSERR;
}
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey1);
@@ -116,11 +116,11 @@ testMultiKey (const char *word)
sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
{
GNUNET_break (0);
- fprintf (stderr, " ERROR\n");
+ FPRINTF (stderr, "%s", " ERROR\n");
return GNUNET_SYSERR;
}
}
- fprintf (stderr, " OK\n");
+ FPRINTF (stderr, "%s", " OK\n");
return GNUNET_OK;
}
@@ -135,19 +135,19 @@ testEncryptDecrypt (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey)
struct GNUNET_TIME_Absolute start;
int ok;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
ok = 0;
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
&target))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
ok++;
continue;
}
@@ -155,7 +155,7 @@ testEncryptDecrypt (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey)
GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result,
strlen (TESTSTRING) + 1))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
ok++;
continue;
}
@@ -186,17 +186,17 @@ testSignVerify (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey)
struct GNUNET_TIME_Absolute start;
int ok = GNUNET_OK;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
purp.size = htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose));
purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
ok = GNUNET_SYSERR;
continue;
}
diff --git a/src/util/test_crypto_random.c b/src/util/test_crypto_random.c
index 46d3ed0aa..681947a60 100644
--- a/src/util/test_crypto_random.c
+++ b/src/util/test_crypto_random.c
@@ -43,7 +43,7 @@ test (enum GNUNET_CRYPTO_Quality mode)
b2 = GNUNET_CRYPTO_random_permute (mode, 1024);
if (0 == memcmp (b2, buf, sizeof (buf)))
{
- fprintf (stderr, "!");
+ FPRINTF (stderr, "%s", "!");
GNUNET_free (b2);
continue;
}
diff --git a/src/util/test_crypto_rsa.c b/src/util/test_crypto_rsa.c
index f26a76a38..f6800afcd 100644
--- a/src/util/test_crypto_rsa.c
+++ b/src/util/test_crypto_rsa.c
@@ -47,7 +47,7 @@ testEncryptDecrypt ()
struct GNUNET_TIME_Absolute start;
int ok;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
@@ -55,12 +55,12 @@ testEncryptDecrypt ()
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
&target))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
ok++;
continue;
}
@@ -68,7 +68,7 @@ testEncryptDecrypt ()
GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result,
strlen (TESTSTRING) + 1))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
ok++;
continue;
@@ -102,7 +102,7 @@ testEncryptPerformance ()
struct GNUNET_TIME_Absolute start;
int ok;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
@@ -110,12 +110,12 @@ testEncryptPerformance ()
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
&target))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
ok++;
continue;
}
@@ -142,7 +142,7 @@ testEncryptDecryptSK ()
struct GNUNET_TIME_Absolute start;
int ok;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
@@ -150,14 +150,14 @@ testEncryptDecryptSK ()
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
GNUNET_CRYPTO_aes_create_session_key (&insk);
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_rsa_encrypt (&insk,
sizeof (struct GNUNET_CRYPTO_AesSessionKey),
&pkey, &target))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
ok++;
continue;
}
@@ -165,7 +165,7 @@ testEncryptDecryptSK ()
GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, &outsk,
sizeof (struct GNUNET_CRYPTO_AesSessionKey)))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
ok++;
continue;
}
@@ -198,7 +198,7 @@ testSignVerify ()
struct GNUNET_TIME_Absolute start;
int ok = GNUNET_OK;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
@@ -207,10 +207,10 @@ testSignVerify ()
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
ok = GNUNET_SYSERR;
continue;
}
@@ -253,16 +253,16 @@ testSignPerformance ()
purp.size = htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose));
purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
ok = GNUNET_SYSERR;
continue;
}
diff --git a/src/util/test_disk.c b/src/util/test_disk.c
index 91154a6f5..546277256 100644
--- a/src/util/test_disk.c
+++ b/src/util/test_disk.c
@@ -46,13 +46,13 @@ testReadWrite ()
ret = GNUNET_DISK_fn_read (".testfile", tmp, sizeof (tmp) - 1);
if (ret < 0)
{
- fprintf (stderr, "Error reading file `%s' in testReadWrite\n", ".testfile");
+ FPRINTF (stderr, "Error reading file `%s' in testReadWrite\n", ".testfile");
return 1;
}
tmp[ret] = '\0';
if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
{
- fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
+ FPRINTF (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
TESTSTRING, ".testfile");
return 1;
}
@@ -61,14 +61,14 @@ testReadWrite ()
ret = GNUNET_DISK_fn_read (".testfile2", tmp, sizeof (tmp) - 1);
if (ret < 0)
{
- fprintf (stderr, "Error reading file `%s' in testReadWrite\n",
+ FPRINTF (stderr, "Error reading file `%s' in testReadWrite\n",
".testfile2");
return 1;
}
tmp[ret] = '\0';
if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
{
- fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
+ FPRINTF (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
TESTSTRING, ".testfile2");
return 1;
}
@@ -276,7 +276,7 @@ main (int argc, char *argv[])
failureCount += testDirMani ();
if (failureCount != 0)
{
- fprintf (stderr, "\n%u TESTS FAILED!\n", failureCount);
+ FPRINTF (stderr, "\n%u TESTS FAILED!\n", failureCount);
return -1;
}
return 0;
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index df8520546..78538404a 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -75,7 +75,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
bytes = GNUNET_DISK_file_read (stdout_read_handle, &buf, sizeof (buf));
#if VERBOSE
- fprintf (stderr, "bytes is %d\n", bytes);
+ FPRINTF (stderr, "bytes is %d\n", bytes);
#endif
if (bytes < 1)
@@ -89,7 +89,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
ok = strncmp (&buf[0], test_phrase, strlen (test_phrase));
#if VERBOSE
- fprintf (stderr, "read %s\n", &buf[0]);
+ FPRINTF (stderr, "read %s\n", &buf[0]);
#endif
if (ok == 0)
{
diff --git a/src/util/test_peer.c b/src/util/test_peer.c
index 3817d8243..9bf443600 100644
--- a/src/util/test_peer.c
+++ b/src/util/test_peer.c
@@ -69,7 +69,7 @@ check ()
pid = GNUNET_PEER_intern (&pidArr[i]);
if (pid != (i + 1))
{
- fprintf (stderr, "Unexpected Peer ID returned by intern function\n");
+ FPRINTF (stderr, "%s", "Unexpected Peer ID returned by intern function\n");
return 1;
}
}
@@ -80,7 +80,7 @@ check ()
pid = GNUNET_PEER_intern (&pidArr[i]);
if (pid != (i + 1))
{
- fprintf (stderr, "Unexpected Peer ID returned by intern function\n");
+ FPRINTF (stderr, "%s", "Unexpected Peer ID returned by intern function\n");
return 1;
}
}
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c
index 4e248aa72..75140f8d5 100644
--- a/src/util/test_resolver_api.c
+++ b/src/util/test_resolver_api.c
@@ -264,8 +264,8 @@ run (void *cls, char *const *args, const char *cfgfile,
_("gethostbyname() could not lookup IP address: %s\n"),
hstrerror (h_errno));
#endif
- fprintf (stderr,
- "System seems to be off-line, will not run all DNS tests\n");
+ FPRINTF (stderr,
+ "System seems to be off-line, will not run all DNS tests\n", NULL);
*ok = 0; /* mark test as passing anyway */
return;
}
@@ -422,7 +422,7 @@ check ()
GNUNET_OS_process_close (proc);
proc = NULL;
if (ok != 0)
- fprintf (stderr, "Missed some resolutions: %u\n", ok);
+ FPRINTF (stderr, "Missed some resolutions: %u\n", ok);
return ok;
}
diff --git a/src/util/test_scheduler_delay.c b/src/util/test_scheduler_delay.c
index ff6966a87..9cbf7d90f 100644
--- a/src/util/test_scheduler_delay.c
+++ b/src/util/test_scheduler_delay.c
@@ -59,10 +59,10 @@ test_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
target =
GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_MILLISECONDS, i));
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (i > MAXV)
{
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
return;
}
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
@@ -79,13 +79,13 @@ check ()
FPRINTF (stdout, "Sleep precision: %llu ms. ",
cumDelta / 1000 / (MAXV / INCR));
if (cumDelta <= 10 * MAXV / INCR)
- fprintf (stdout, "Timer precision is excellent.\n");
+ FPRINTF (stdout, "%s", "Timer precision is excellent.\n");
else if (cumDelta <= 50 * MAXV / INCR) /* 50 ms average deviation */
- fprintf (stdout, "Timer precision is good.\n");
+ FPRINTF (stdout, "%s", "Timer precision is good.\n");
else if (cumDelta > 250 * MAXV / INCR)
- fprintf (stdout, "Timer precision is awful.\n");
+ FPRINTF (stdout, "%s", "Timer precision is awful.\n");
else
- fprintf (stdout, "Timer precision is acceptable.\n");
+ FPRINTF (stdout, "%s", "Timer precision is acceptable.\n");
return 0;
}
diff --git a/src/util/test_service.c b/src/util/test_service.c
index 1b78932f8..eff8c7570 100644
--- a/src/util/test_service.c
+++ b/src/util/test_service.c
@@ -270,7 +270,7 @@ main (int argc, char *argv[])
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket");
return 1;
}
- fprintf (stderr,
+ FPRINTF (stderr,
"IPv6 support seems to not be available (%s), not testing it!\n",
strerror (errno));
}
diff --git a/src/util/test_strings.c b/src/util/test_strings.c
index c6d604144..7e68153d7 100644
--- a/src/util/test_strings.c
+++ b/src/util/test_strings.c
@@ -89,7 +89,7 @@ check ()
* however, the "0:05 19" should always be there; hence: */
if (NULL == strstr (r, "0:05 19"))
{
- fprintf (stderr, "Got %s\n", r);
+ FPRINTF (stderr, "Got %s\n", r);
GNUNET_break (0);
GNUNET_free (r);
return 1;