aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/calendar.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1999-09-28 04:56:29 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-09-28 04:56:29 +0800
commit241a65b72b3620f85bad00fac28d268e5f47d2d6 (patch)
tree94f749268b21a9ae37a71ff2ad2cb91cc23e311a /calendar/calendar.c
parent9d0b58bb8eb5a2180c6d38d7e45c9396331dc725 (diff)
downloadgsoc2013-evolution-241a65b72b3620f85bad00fac28d268e5f47d2d6.tar
gsoc2013-evolution-241a65b72b3620f85bad00fac28d268e5f47d2d6.tar.gz
gsoc2013-evolution-241a65b72b3620f85bad00fac28d268e5f47d2d6.tar.bz2
gsoc2013-evolution-241a65b72b3620f85bad00fac28d268e5f47d2d6.tar.lz
gsoc2013-evolution-241a65b72b3620f85bad00fac28d268e5f47d2d6.tar.xz
gsoc2013-evolution-241a65b72b3620f85bad00fac28d268e5f47d2d6.tar.zst
gsoc2013-evolution-241a65b72b3620f85bad00fac28d268e5f47d2d6.zip
Small fix -miguel
svn path=/trunk/; revision=1265
Diffstat (limited to 'calendar/calendar.c')
-rw-r--r--calendar/calendar.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/calendar/calendar.c b/calendar/calendar.c
index e6c6dddf59..cffd2476c4 100644
--- a/calendar/calendar.c
+++ b/calendar/calendar.c
@@ -358,15 +358,15 @@ vcalendar_create_from_calendar (Calendar *cal)
VObject *vcal;
GList *l;
time_t now = time (NULL);
- struct tm *tm;
+ struct tm tm;
/* WE call localtime for the side effect of setting tzname */
- tm = localtime (&now);
+ tm = *localtime (&now);
vcal = newVObject (VCCalProp);
addPropValue (vcal, VCProdIdProp, "-//GNOME//NONSGML GnomeCalendar//EN");
#if defined(HAVE_TM_ZONE)
- addPropValue (vcal, VCTimeZoneProp, tm->tm_zone);
+ addPropValue (vcal, VCTimeZoneProp, tm.tm_zone);
#elif defined(HAVE_TZNAME)
addPropValue (vcal, VCTimeZoneProp, tzname[0]);
#endif
@@ -391,6 +391,9 @@ vcalendar_create_from_calendar (Calendar *cal)
addVObjectProp (vcal, obj);
}
+ cleanVObject (vcal);
+ cleanStrTbl ();
+
return vcal;
}
@@ -417,8 +420,8 @@ calendar_save (Calendar *cal, char *fname)
g_free (backup_name);
}
- fp = fopen(fname,"w");
- if (fp) {
+ fp = fopen(fname,"w");
+ if (fp) {
writeVObject(fp, vcal);
fclose(fp);
if (strcmp(cal->filename, fname)) {
@@ -430,10 +433,10 @@ calendar_save (Calendar *cal, char *fname)
cal->file_time = s.st_mtime;
} else {
dlg = gnome_message_box_new(_("Failed to save calendar!"),
- GNOME_MESSAGE_BOX_ERROR, "Ok", NULL);
+ GNOME_MESSAGE_BOX_ERROR, "Ok", NULL);
gtk_widget_show(dlg);
}
-
+
cleanVObject (vcal);
cleanStrTbl ();
}