From 5eb7fd6635d47317ecce261940bb6e951abdc5c8 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 04 Nov 2017 13:30:58 -0400 Subject: mq_html_input_radio(): Allow label to be disabled --- (limited to 'src/utils') diff --git a/src/utils/html.c b/src/utils/html.c index 744e74d..ac4ae9f 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -685,9 +685,20 @@ gchar * mq_html_input_radio(const gchar *name, const gchar *id, const gchar *label, gboolean checked) { - return g_strdup_printf("\n", - name, label, name, id, checked ? " checked=\"checked\"" : ""); + if (label && label[0]) { + return g_strdup_printf( + "\n", + name, label, name, id, + checked ? " checked=\"checked\"" : ""); + } else { + return g_strdup_printf( + "\n", + name, id, + checked ? " checked=\"checked\"" : ""); + } } gchar * -- cgit v0.9.1