summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-01 16:31:29 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-11-01 16:31:29 (EDT)
commit11abba7bcb223279706a933023ceedd64a5aa1f6 (patch)
tree0bdbdf34cfc5d799e649be565d84bafe9d786137 /src/utils
parentc8b3d8a95e463b22dda6a54ea36f6c7328314e57 (diff)
downloadmarquee-11abba7bcb223279706a933023ceedd64a5aa1f6.zip
marquee-11abba7bcb223279706a933023ceedd64a5aa1f6.tar.gz
marquee-11abba7bcb223279706a933023ceedd64a5aa1f6.tar.bz2
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); ^
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/resources.c28
1 files changed, 14 insertions, 14 deletions
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 =
- "<!doctype html>\n"
- "<html dir=\"%s\">\n"
- "<head>\n"
- "<meta charset=\"utf-8\">\n"
- "<title>Resource Error</title>\n"
- "</head>\n"
- "<body>\n"
- "<h1>Resource Error</h1>\n"
- "<p>Failed to load resource &ldquo;%s&rdquo;</p>\n"
- "<p>%s</p>\n"
- "</body>\n"
- "</html>\n";
+#define ERROR_DOCUMENT \
+ "<!doctype html>\n" \
+ "<html dir=\"%s\">\n" \
+ "<head>\n" \
+ "<meta charset=\"utf-8\">\n" \
+ "<title>Resource Error</title>\n" \
+ "</head>\n" \
+ "<body>\n" \
+ "<h1>Resource Error</h1>\n" \
+ "<p>Failed to load resource &ldquo;%s&rdquo;</p>\n" \
+ "<p>%s</p>\n" \
+ "</body>\n" \
+ "</html>\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);