diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/html.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/utils/html.c b/src/utils/html.c index 3b5be2c..9632baa 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -664,11 +664,21 @@ gchar * mq_html_input_number_d(const gchar *name, const gchar *label, gdouble min, gdouble step, gdouble max, gdouble value) { - return g_strdup_printf("<label for=\"%s\">\n<span>%s:</span>\n" - "<input type=\"number\" name=\"%s\" id=\"%s\"" - " min=\"%f\" step=\"%f\" max=\"%f\" value=\"%f\">\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=\"%f\" step=\"%f\" max=\"%f\" " + "value=\"%f\">\n" + "</label>\n", + name, label, name, name, min, step, max, value); + } else { + return g_strdup_printf( + "<input type=\"number\" name=\"%s\" id=\"%s\" " + "min=\"%f\" step=\"%f\" max=\"%f\" " + "value=\"%f\">\n", + name, name, min, step, max, value); + } } gchar * |