summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/utils/html.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/utils/html.c b/src/utils/html.c
index 68af9a6..3b5be2c 100644
--- a/src/utils/html.c
+++ b/src/utils/html.c
@@ -643,11 +643,21 @@ gchar *
mq_html_input_number_i(const gchar *name, const gchar *label,
gint min, gint step, gint max, gint value)
{
- return g_strdup_printf("<label for=\"%s\">\n<span>%s:</span>\n"
- "<input type=\"number\" name=\"%s\" id=\"%s\""
- " min=\"%d\" step=\"%d\" max=\"%d\" value=\"%d\">\n"
- "</label>\n",
- name, label, name, name, min, step, max, value);
+ if (label && label[0]) {
+ return g_strdup_printf(
+ "<label for=\"%s\">\n<span>%s:</span>\n"
+ "<input type=\"number\" name=\"%s\" id=\"%s\" "
+ "min=\"%d\" step=\"%d\" max=\"%d\" "
+ "value=\"%d\">\n"
+ "</label>\n",
+ name, label, name, name, min, step, max, value);
+ } else {
+ return g_strdup_printf(
+ "<input type=\"number\" name=\"%s\" id=\"%s\" "
+ "min=\"%d\" step=\"%d\" max=\"%d\" "
+ "value=\"%d\">\n",
+ name, name, min, step, max, value);
+ }
}
gchar *