aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-09-29 19:17:47 -0400
committerDavid Robillard <d@drobilla.net>2024-10-12 11:10:39 -0400
commitb93cf5147d5c63f563812990e491cd6ce61a87c4 (patch)
treea1698d295641895ba6fb2bd3c83e9a6f5bb6512e /src
parentdb7c58a3b770eb4688b2e1c6de4c39172fada6c3 (diff)
downloadjalv-b93cf5147d5c63f563812990e491cd6ce61a87c4.tar.gz
jalv-b93cf5147d5c63f563812990e491cd6ce61a87c4.tar.bz2
jalv-b93cf5147d5c63f563812990e491cd6ce61a87c4.zip
Avoid use of non-literal format string
Diffstat (limited to 'src')
-rw-r--r--src/jalv_gtk.c8
1 files changed, 5 insertions, 3 deletions
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 ? "<span font_weight=\"bold\">%s</span>" : "%s:";
- gchar* str = g_markup_printf_escaped(fmt, text);
+ GtkWidget* const label = gtk_label_new(NULL);
+ gchar* const str =
+ title
+ ? g_markup_printf_escaped("<span font_weight=\"bold\">%s</span>", text)
+ : g_markup_printf_escaped("%s:", text);
gtk_widget_set_halign(label, xalign);
gtk_widget_set_valign(label, yalign);