aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-component-memo-preview.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-cal-component-memo-preview.c')
-rw-r--r--calendar/gui/e-cal-component-memo-preview.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/calendar/gui/e-cal-component-memo-preview.c b/calendar/gui/e-cal-component-memo-preview.c
index 4ae6854a27..9a0a8c854b 100644
--- a/calendar/gui/e-cal-component-memo-preview.c
+++ b/calendar/gui/e-cal-component-memo-preview.c
@@ -227,11 +227,14 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone
gtk_html_stream_printf (stream, "<TD>");
for (node = l; node != NULL; node = node->next) {
- gint i, j;
- GString *string = g_string_new (NULL);
+ gint i, j, len;
+ GString *string;
text = * (ECalComponentText *) node->data;
- for (i = 0, j=0; i < strlen (text.value ? text.value : 0); i++, j++) {
+ len = (text.value ? strlen (text.value) : 0);
+ string = g_string_sized_new (len + 1);
+
+ for (i = 0, j=0; i < len; i++, j++) {
if (text.value[i] == '\n'){
string = g_string_append_len (string, "<BR>", 4);
}