Fix uninitialized variable
In the 'icaltime_compare_with_current' function, the 'result' was uninitialized. As a consequence, this simplifies the if-else condition. https://bugzilla.gnome.org/show_bug.cgi?id=759588
This commit is contained in:
committed by
Erick Perez Castellanos
parent
ed580933ea
commit
2001273c28
+2
-6
@@ -417,7 +417,7 @@ icaltime_compare_with_current (const icaltimetype *date1,
|
||||
const icaltimetype *date2,
|
||||
time_t *current_time_t)
|
||||
{
|
||||
gint result;
|
||||
gint result = 0;
|
||||
|
||||
time_t start1, start2, diff1, diff2;
|
||||
start1 = icaltime_as_timet_with_zone (*date1, date1->zone != NULL ? date1->zone : e_cal_util_get_system_timezone ());
|
||||
@@ -425,11 +425,7 @@ icaltime_compare_with_current (const icaltimetype *date1,
|
||||
diff1 = start1 - *current_time_t;
|
||||
diff2 = start2 - *current_time_t;
|
||||
|
||||
if (diff1 == diff2)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
if (diff1 != diff2)
|
||||
{
|
||||
if (diff1 == 0)
|
||||
result = -1;
|
||||
|
||||
Reference in New Issue
Block a user