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 --- src/jalv_gtk.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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