From b93cf5147d5c63f563812990e491cd6ce61a87c4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Sep 2024 19:17:47 -0400 Subject: Avoid use of non-literal format string --- meson/suppressions/meson.build | 2 -- src/jalv_gtk.c | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build index 6d2670c..5885389 100644 --- a/meson/suppressions/meson.build +++ b/meson/suppressions/meson.build @@ -25,7 +25,6 @@ if is_variable('cc') '-Wno-double-promotion', '-Wno-float-conversion', '-Wno-float-equal', - '-Wno-format-nonliteral', '-Wno-implicit-float-conversion', '-Wno-missing-noreturn', '-Wno-padded', @@ -72,7 +71,6 @@ if is_variable('cc') '-Wno-conversion', '-Wno-double-promotion', '-Wno-float-equal', - '-Wno-format-nonliteral', '-Wno-inline', '-Wno-padded', '-Wno-strict-overflow', diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c index fd2875c..feab6c5 100644 --- a/src/jalv_gtk.c +++ b/src/jalv_gtk.c @@ -1108,9 +1108,11 @@ make_controller(ControlID* control, float value) static GtkWidget* new_label(const char* text, bool title, GtkAlign xalign, GtkAlign yalign) { - GtkWidget* label = gtk_label_new(NULL); - const char* fmt = title ? "%s" : "%s:"; - gchar* str = g_markup_printf_escaped(fmt, text); + GtkWidget* const label = gtk_label_new(NULL); + gchar* const str = + title + ? g_markup_printf_escaped("%s", text) + : g_markup_printf_escaped("%s:", text); gtk_widget_set_halign(label, xalign); gtk_widget_set_valign(label, yalign); -- cgit v1.2.1