aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/calobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/pcs/calobj.c')
-rw-r--r--calendar/pcs/calobj.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c
index 641c3fbf8b..47d8c8a97e 100644
--- a/calendar/pcs/calobj.c
+++ b/calendar/pcs/calobj.c
@@ -676,15 +676,23 @@ store_list (VObject *o, char *prop, GList *values, char sep)
len += strlen (l->data) + 1;
result = g_malloc (len);
- for (p = result, l = values; l; l = l->next){
+
+ for (p = result, l = values; l; l = l->next) {
int len = strlen (l->data);
strcpy (p, l->data);
- p [len] = sep;
- p += len+1;
+
+ if (l->next) {
+ p [len] = sep;
+ p += len+1;
+ } else
+ p += len;
}
+
+ *p = 0;
+
addPropValue (o, prop, result);
- g_free (p);
+ g_free (result);
}
static char *recur_type_name [] = { "D", "W", "MP", "MD", "YM", "YD" };