diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-04 12:49:02 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-04 12:50:38 (EDT) |
commit | 86945e9ab330160562ca194bc0d845d84ca97062 (patch) | |
tree | 72a16cf7aaad099ce8ac574e8daba2b1d064f050 | |
parent | bac3792a28a03289c32fde5458921ce06d986545 (diff) | |
download | marquee-86945e9ab330160562ca194bc0d845d84ca97062.zip marquee-86945e9ab330160562ca194bc0d845d84ca97062.tar.gz marquee-86945e9ab330160562ca194bc0d845d84ca97062.tar.bz2 |
mq_html_form(): Split button box code and strings
-rw-r--r-- | src/utils/html.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/utils/html.c b/src/utils/html.c index d377046..c1075e8 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -580,11 +580,15 @@ mq_html_form(const gchar *submit_label, const gchar *reset_label, ...) len += strlen(child); } va_end(ap); - len += strlen("<div class=\"dialog-buttonbox\">\n") + - strlen("<input type=\"reset\" value=\"") + strlen(reset_label) + - strlen("\">\n<input type=\"submit\" value=\"") + - strlen(submit_label) + strlen("\">\n</div>\n") + - strlen("</form>\n"); + len += strlen("<div class=\"dialog-buttonbox\">\n"); + len += strlen("<input type=\"reset\" value=\""); + len += strlen(reset_label); + len += strlen("\">\n"); + len += strlen("<input type=\"submit\" value=\""); + len += strlen(submit_label); + len += strlen("\">\n"); + len += strlen("</div>\n"); + len += strlen("</form>\n"); ++len; /* NUL byte */ /* Build string. */ @@ -599,9 +603,11 @@ mq_html_form(const gchar *submit_label, const gchar *reset_label, ...) ptr = g_stpcpy(ptr, "<div class=\"dialog-buttonbox\">\n"); ptr = g_stpcpy(ptr, "<input type=\"reset\" value=\""); ptr = g_stpcpy(ptr, reset_label); - ptr = g_stpcpy(ptr, "\">\n<input type=\"submit\" value=\""); + ptr = g_stpcpy(ptr, "\">\n"); + ptr = g_stpcpy(ptr, "<input type=\"submit\" value=\""); ptr = g_stpcpy(ptr, submit_label); - ptr = g_stpcpy(ptr, "\">\n</div>\n"); + ptr = g_stpcpy(ptr, "\">\n"); + ptr = g_stpcpy(ptr, "</div>\n"); ptr = g_stpcpy(ptr, "</form>\n"); /* g_stpcpy() adds the NUL. */ return form; |