diff options
-rw-r--r-- | src/utils/html.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/utils/html.c b/src/utils/html.c index 936ba05..95d7cdc 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -210,7 +210,9 @@ mq_html_document(const gchar *title, const gchar *styles, len += strlen(title); len += strlen("</title>\n<style>\n"); len += strlen(global_styles); - len += strlen(styles); + if (styles) { + len += strlen(styles); + } len += strlen("</style>\n"); if (head_tags) { len += strlen(head_tags); @@ -233,7 +235,9 @@ mq_html_document(const gchar *title, const gchar *styles, ptr = g_stpcpy(ptr, title); ptr = g_stpcpy(ptr, "</title>\n<style>\n"); ptr = g_stpcpy(ptr, global_styles); - ptr = g_stpcpy(ptr, styles); + if (styles) { + ptr = g_stpcpy(ptr, styles); + } ptr = g_stpcpy(ptr, "</style>\n"); if (head_tags) { ptr = g_stpcpy(ptr, head_tags); @@ -266,7 +270,9 @@ mq_html_document_v(const gchar *title, const gchar *styles, len += strlen(title); len += strlen("</title>\n<style>\n"); len += strlen(global_styles); - len += strlen(styles); + if (styles) { + len += strlen(styles); + } len += strlen("</style>\n"); if (head_tags) { len += strlen(head_tags); @@ -287,7 +293,9 @@ mq_html_document_v(const gchar *title, const gchar *styles, ptr = g_stpcpy(ptr, title); ptr = g_stpcpy(ptr, "</title>\n<style>\n"); ptr = g_stpcpy(ptr, global_styles); - ptr = g_stpcpy(ptr, styles); + if (styles) { + ptr = g_stpcpy(ptr, styles); + } ptr = g_stpcpy(ptr, "</style>\n"); if (head_tags) { ptr = g_stpcpy(ptr, head_tags); |