From f9a9813ccb20568eb2515368b656e24af3d871ab Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 2 Jun 2004 16:15:00 +0000 Subject: [PATCH] only allow values from 0 to time_t's maximum value. 2004-06-02 Rodrigo Moya * libecal/e-cal.c (e_cal_generate_instances, e_cal_generate_instances_for_object, e_cal_get_alarms_in_range, e_cal_get_alarms_for_object): only allow values from 0 to time_t's maximum value. * libecal/e-cal.h: added missing prototype. --- calendar/ChangeLog | 9 +++++++++ calendar/libecal/e-cal.c | 16 +++++++++------- calendar/libecal/e-cal.h | 5 +++++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 214c951..591c717 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2004-06-02 Rodrigo Moya + + * libecal/e-cal.c (e_cal_generate_instances, + e_cal_generate_instances_for_object, e_cal_get_alarms_in_range, + e_cal_get_alarms_for_object): only allow values from 0 to time_t's + maximum value. + + * libecal/e-cal.h: added missing prototype. + 2004-06-01 Rodrigo Moya * libecal/e-cal.c (e_cal_generate_instances): moved all the logic... diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c index 37d4039..e5ba6db 100644 --- a/calendar/libecal/e-cal.c +++ b/calendar/libecal/e-cal.c @@ -1,8 +1,10 @@ /* Evolution calendar ecal * * Copyright (C) 2001 Ximian, Inc. + * Copyright (C) 2004 Novell, Inc. * - * Author: Federico Mena-Quintero + * Authors: Federico Mena-Quintero + * Rodrigo Moya * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -3008,8 +3010,8 @@ e_cal_generate_instances (ECal *ecal, time_t start, time_t end, priv = ecal->priv; g_return_if_fail (priv->load_state == E_CAL_LOAD_LOADED); - g_return_if_fail (start >= -1); - g_return_if_fail (end >= -1); + g_return_if_fail (start >= 0); + g_return_if_fail (end >= 0); g_return_if_fail (cb != NULL); generate_instances (ecal, start, end, NULL, cb, cb_data); @@ -3043,8 +3045,8 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp, GList *instances = NULL; g_return_if_fail (E_IS_CAL (ecal)); - g_return_if_fail (start >= -1); - g_return_if_fail (end >= -1); + g_return_if_fail (start >= 0); + g_return_if_fail (end >= 0); g_return_if_fail (cb != NULL); priv = ecal->priv; @@ -3143,7 +3145,7 @@ e_cal_get_alarms_in_range (ECal *ecal, time_t start, time_t end) priv = ecal->priv; g_return_val_if_fail (priv->load_state == E_CAL_LOAD_LOADED, NULL); - g_return_val_if_fail (start != -1 && end != -1, NULL); + g_return_val_if_fail (start >= 0 && end >= 0, NULL); g_return_val_if_fail (start <= end, NULL); /* build the query string */ @@ -3220,7 +3222,7 @@ e_cal_get_alarms_for_object (ECal *ecal, const char *uid, g_return_val_if_fail (priv->load_state == E_CAL_LOAD_LOADED, FALSE); g_return_val_if_fail (uid != NULL, FALSE); - g_return_val_if_fail (start != -1 && end != -1, FALSE); + g_return_val_if_fail (start >= 0 && end >= 0, FALSE); g_return_val_if_fail (start <= end, FALSE); g_return_val_if_fail (alarms != NULL, FALSE); diff --git a/calendar/libecal/e-cal.h b/calendar/libecal/e-cal.h index 090883d..7046059 100644 --- a/calendar/libecal/e-cal.h +++ b/calendar/libecal/e-cal.h @@ -1,8 +1,10 @@ /* Evolution calendar ecal * * Copyright (C) 2001 Ximian, Inc. + * Copyright (C) 2004 Novell, Inc. * * Authors: Federico Mena-Quintero + * Rodrigo Moya * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -152,6 +154,9 @@ gboolean e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end void e_cal_generate_instances (ECal *ecal, time_t start, time_t end, ECalRecurInstanceFn cb, gpointer cb_data); +void e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp, + time_t start, time_t end, + ECalRecurInstanceFn cb, gpointer cb_data); GSList *e_cal_get_alarms_in_range (ECal *ecal, time_t start, time_t end); -- 2.7.4