aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r--mail/em-format-html.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 824d3b115d..0cb3e15cb2 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1433,11 +1433,14 @@ efh_format_address (GString *out, struct _camel_header_address *a)
g_string_append_printf (out, "%s <", name);
/* rfc2368 for mailto syntax and url encoding extras */
- real = camel_header_encode_phrase(a->name);
- mailaddr = g_strdup_printf("%s <%s>", real, a->v.addr);
- g_free(real);
- mailto = camel_url_encode(mailaddr, "?=&()");
- g_free(mailaddr);
+ if ((real = camel_header_encode_phrase (a->name))) {
+ mailaddr = g_strdup_printf("%s <%s>", real, a->v.addr);
+ g_free (real);
+ mailto = camel_url_encode (mailaddr, "?=&()");
+ g_free (mailaddr);
+ } else {
+ mailto = camel_url_encode (a->v.addr, "?=&()");
+ }
} else {
mailto = camel_url_encode (a->v.addr, "?=&()");
}