diff options
-rw-r--r-- | src/utils/html.c | 17 |
1 files changed, 14 insertions, 3 deletions
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("<label for=\"%s\">\n<span>%s:</span>\n" - "<input type=\"radio\" name=\"%s\" id=\"%s\"%s>\n</label>\n", - name, label, name, id, checked ? " checked=\"checked\"" : ""); + if (label && label[0]) { + return g_strdup_printf( + "<label for=\"%s\">\n<span>%s:</span>\n" + "<input type=\"radio\" name=\"%s\" " + "id=\"%s\"%s>\n" + "</label>\n", + name, label, name, id, + checked ? " checked=\"checked\"" : ""); + } else { + return g_strdup_printf( + "<input type=\"radio\" name=\"%s\" id=\"%s\"%s>\n", + name, id, + checked ? " checked=\"checked\"" : ""); + } } gchar * |