From 11abba7bcb223279706a933023ceedd64a5aa1f6 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 01 Nov 2017 16:31:29 -0400 Subject: src/utils/resources.c: Convert static const error_document var to macro Fixes: CC src/utils/marquee-resources.o src/utils/resources.c: In function ‘mq_resource_response’: src/utils/resources.c:64:5: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] path, error->message), -1, g_free); ^ --- diff --git a/src/utils/resources.c b/src/utils/resources.c index 7272cec..20291a8 100644 --- a/src/utils/resources.c +++ b/src/utils/resources.c @@ -26,19 +26,19 @@ #include "../application.h" -static const gchar *error_document = - "\n" - "\n" - "\n" - "\n" - "Resource Error\n" - "\n" - "\n" - "

Resource Error

\n" - "

Failed to load resource “%s”

\n" - "

%s

\n" - "\n" - "\n"; +#define ERROR_DOCUMENT \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "Resource Error\n" \ + "\n" \ + "\n" \ + "

Resource Error

\n" \ + "

Failed to load resource “%s”

\n" \ + "

%s

\n" \ + "\n" \ + "\n" void mq_resource_response(MqApplication *application, const gchar *path, @@ -58,7 +58,7 @@ mq_resource_response(MqApplication *application, const gchar *path, stream = G_INPUT_STREAM(g_file_read(file, NULL, &error)); if (!stream) { stream = g_memory_input_stream_new_from_data( - g_strdup_printf(error_document, + g_strdup_printf(ERROR_DOCUMENT, gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL ? "rtl" : "ltr", path, error->message), -1, g_free); -- cgit v0.9.1