From c2c2ecbf7d021bb5445a205ec8c66286afaf1008 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Sun, 8 Dec 2013 15:41:56 -0500 Subject: fix up non-literal format string issues Fix up a couple of errors picked up by -Werror=format-nonliteral on clang. https://bugzilla.gnome.org/show_bug.cgi?id=720082 --- libsoup/soup-xmlrpc.c | 5 +++++ tests/coding-test.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libsoup/soup-xmlrpc.c b/libsoup/soup-xmlrpc.c index 8d711d3b..e2890100 100644 --- a/libsoup/soup-xmlrpc.c +++ b/libsoup/soup-xmlrpc.c @@ -289,6 +289,11 @@ soup_xmlrpc_build_method_response (GValue *value) return body; } +static char * +soup_xmlrpc_build_faultv (int fault_code, + const char *fault_format, + va_list args) G_GNUC_PRINTF (2, 0); + static char * soup_xmlrpc_build_faultv (int fault_code, const char *fault_format, va_list args) { diff --git a/tests/coding-test.c b/tests/coding-test.c index 30417b47..1bffbc43 100644 --- a/tests/coding-test.c +++ b/tests/coding-test.c @@ -33,7 +33,7 @@ server_callback (SoupServer *server, SoupMessage *msg, if (codings) { gboolean claim_deflate, claim_gzip; - const char *file_path = NULL, *encoding = NULL; + const char *extension = NULL, *encoding = NULL; claim_deflate = g_slist_find_custom (codings, "deflate", (GCompareFunc)g_ascii_strcasecmp) != NULL; claim_gzip = g_slist_find_custom (codings, "gzip", (GCompareFunc)g_ascii_strcasecmp) != NULL; @@ -41,19 +41,19 @@ server_callback (SoupServer *server, SoupMessage *msg, if (claim_gzip && (!claim_deflate || (!soup_header_contains (options, "prefer-deflate-zlib") && !soup_header_contains (options, "prefer-deflate-raw")))) { - file_path = SRCDIR "/resources%s.gz"; + extension = "gz"; encoding = "gzip"; } else if (claim_deflate) { if (soup_header_contains (options, "prefer-deflate-raw")) { - file_path = SRCDIR "/resources%s.raw"; + extension = "raw"; encoding = "deflate"; } else { - file_path = SRCDIR "/resources%s.zlib"; + extension = "zlib"; encoding = "deflate"; } } - if (file_path && encoding) { - file = g_strdup_printf (file_path, path); + if (extension && encoding) { + file = g_strdup_printf (SRCDIR "/resources%s.%s", path, extension); if (g_file_test (file, G_FILE_TEST_EXISTS)) { soup_message_headers_append (msg->response_headers, "Content-Encoding", -- cgit v1.2.1