xed/fix_format_string_error.patch
2017-04-01 17:07:19 +01:00

30 lines
931 B
Diff

From 27adad6e289e92da8cbf770ddebfc9287588a429 Mon Sep 17 00:00:00 2001
From: leigh123linux <leigh123linux@googlemail.com>
Date: Sat, 1 Apr 2017 16:56:38 +0100
Subject: [PATCH] fix 'format not a string literal, format string not checked'
error with gcc-7
---
plugins/time/xed-time-plugin.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/plugins/time/xed-time-plugin.c b/plugins/time/xed-time-plugin.c
index 3fd3840..a7ffc0f 100644
--- a/plugins/time/xed-time-plugin.c
+++ b/plugins/time/xed-time-plugin.c
@@ -346,12 +346,15 @@ get_time (const gchar* format)
clock = time (NULL);
now = localtime (&clock);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
do
{
out_length += 255;
out = g_realloc (out, out_length);
}
while (strftime (out, out_length, locale_format, now) == 0);
+#pragma GCC diagnostic pop
g_free (locale_format);