aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-04-18 10:09:54 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-18 10:09:54 +0800
commitd79ee74dad39ee5210482aa90a7c6a7b2f0b7517 (patch)
treea41a2a618e2ac7aa1f13b7625339b1127fe415df /calendar
parent36a42fc60313ee2c15de8b2466bd208a0feff6ae (diff)
downloadgsoc2013-evolution-d79ee74dad39ee5210482aa90a7c6a7b2f0b7517.tar
gsoc2013-evolution-d79ee74dad39ee5210482aa90a7c6a7b2f0b7517.tar.gz
gsoc2013-evolution-d79ee74dad39ee5210482aa90a7c6a7b2f0b7517.tar.bz2
gsoc2013-evolution-d79ee74dad39ee5210482aa90a7c6a7b2f0b7517.tar.lz
gsoc2013-evolution-d79ee74dad39ee5210482aa90a7c6a7b2f0b7517.tar.xz
gsoc2013-evolution-d79ee74dad39ee5210482aa90a7c6a7b2f0b7517.tar.zst
gsoc2013-evolution-d79ee74dad39ee5210482aa90a7c6a7b2f0b7517.zip
Added mandatory status property. (ical_object_to_vobject): Only store
1998-04-17 Federico Mena Quintero <federico@nuclecu.unam.mx> * calobj.c (ical_new): Added mandatory status property. (ical_object_to_vobject): Only store "related" list if it exists. (store_list): Add terminating null char and free the correct data. svn path=/trunk/; revision=154
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog1
-rw-r--r--calendar/cal-util/calobj.c16
-rw-r--r--calendar/calobj.c16
-rw-r--r--calendar/pcs/calobj.c16
4 files changed, 37 insertions, 12 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 962c9a5026..1bd14e83a0 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -2,6 +2,7 @@
* calobj.c (ical_new): Added mandatory status property.
(ical_object_to_vobject): Only store "related" list if it exists.
+ (store_list): Add terminating null char and free the correct data.
* main.c (save_calendar_cmd): Implemented calendar saving.
(open_calendar_cmd): Implemented calendar loading.
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index 641c3fbf8b..47d8c8a97e 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/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" };
diff --git a/calendar/calobj.c b/calendar/calobj.c
index 641c3fbf8b..47d8c8a97e 100644
--- a/calendar/calobj.c
+++ b/calendar/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" };
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" };