Re: [evolution-patches] Save-calendar plugin. saving to comma separated files



On Tue, 2004-11-30 at 00:14 +0100, Philip Van Hoof wrote:
> Hi there,

This little one (which must be applied after the last one to keep these
patches smaller) fixes a little memory issue (when retrieved structs are
NULL).


-- save-calendar.c     2004-11-30 11:05:21.521830445 +0100
+++ save-calendar.c       2004-11-30 11:03:46.825018706 +0100
@@ -336,7 +336,7 @@
                        line = add_string_to_csv (line, temp_constchar, config);

                        e_cal_component_get_summary (comp, &temp_comptext);
-                       line = add_string_to_csv (line, temp_comptext.value, config);
+                       line = add_string_to_csv (line, &temp_comptext?temp_comptext.value:NULL, config);

                        e_cal_component_get_description_list (comp, &temp_list);
                        line = add_list_to_csv (line, temp_list, config, ECALCOMPONENTTEXT);
@@ -363,16 +363,16 @@
                        if (temp_list) e_cal_component_free_text_list (temp_list);

                        e_cal_component_get_dtstart (comp, &temp_dt);
-                       line = add_time_to_csv (line, temp_dt.value, config);
+                       line = add_time_to_csv (line, &temp_dt?temp_dt.value:NULL, config);
                        if (&temp_dt) e_cal_component_free_datetime (&temp_dt);

                        e_cal_component_get_dtend (comp, &temp_dt);
-                       line = add_time_to_csv (line, temp_dt.value, config);
+                       line = add_time_to_csv (line, &temp_dt?temp_dt.value:NULL, config);
                        if (&temp_dt) e_cal_component_free_datetime (&temp_dt);


                        e_cal_component_get_due (comp, &temp_dt);
-                       line = add_time_to_csv (line, temp_dt.value, config);
+                       line = add_time_to_csv (line, &temp_dt?temp_dt.value:NULL, config);
                        if (&temp_dt) e_cal_component_free_datetime (&temp_dt);

                        e_cal_component_get_percent (comp, &temp_int);


-- 
Philip Van Hoof, Software Developer @ Cronos
home: me at freax dot org
gnome: pvanhoof at gnome dot org
work: philip dot vanhoof at cronos dot be
junk: philip dot vanhoof at gmail dot com
http://www.freax.be, http://www.freax.eu.org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]