evolution-data-server r10111 - in trunk/calendar: . libecal



Author: tobiasmue
Date: Sat Feb 28 02:07:30 2009
New Revision: 10111
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=10111&view=rev

Log:
2009-02-28  Tobias Mueller  <tobiasmue svn gnome org>

    ** Fix for bug #573497

    * libecal/e-cal.c: (E_CALENDAR_CHECK_STATUS):
    Use "%s" as format-string to g_set_error.
    * libecal/e-cal.c: (e_calendar_get_op), (e_calendar_remove_op),
    (destroy_factories), (destroy_cal), (cal_alarm_address_cb),
    (cal_ldap_attribute_cb), (cal_static_capabilities_cb),
    (cal_opened_cb), (cal_removed_cb), (cal_object_created_cb):
    Use "%s" as format-string to g_warning or g_message.
    * libecal/e-cal-time-util.c: (isodate_from_time_t):
    Use a fixed sized format-string instead of a const char*



Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/libecal/e-cal-time-util.c
   trunk/calendar/libecal/e-cal.c

Modified: trunk/calendar/libecal/e-cal-time-util.c
==============================================================================
--- trunk/calendar/libecal/e-cal-time-util.c	(original)
+++ trunk/calendar/libecal/e-cal-time-util.c	Sat Feb 28 02:07:30 2009
@@ -580,11 +580,10 @@
 {
 	gchar *ret;
 	struct tm stm;
-	const char *fmt;
+	const char fmt[] = "%04d%02d%02dT%02d%02d%02dZ";
 
 	gmtime_r (&t, &stm);
 	ret = g_malloc (ISODATE_LENGTH);
-	fmt = "%04d%02d%02dT%02d%02d%02dZ";
 	g_snprintf (ret, ISODATE_LENGTH, fmt, (stm.tm_year+1900), (stm.tm_mon+1), stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec);
 
 	return ret;

Modified: trunk/calendar/libecal/e-cal.c
==============================================================================
--- trunk/calendar/libecal/e-cal.c	(original)
+++ trunk/calendar/libecal/e-cal.c	Sat Feb 28 02:07:30 2009
@@ -180,7 +180,7 @@
 	else {                                                          \
                 const char *msg;                                        \
                 msg = e_cal_get_error_message ((status));          \
-		g_set_error ((error), E_CALENDAR_ERROR, (status), msg, (status));	\
+		g_set_error ((error), E_CALENDAR_ERROR, (status), "%s", msg, (status));	\
 		return FALSE;						\
 	}				}G_STMT_END
 
@@ -317,7 +317,7 @@
 e_calendar_get_op (ECal *ecal)
 {
 	if (!ecal->priv->current_op) {
-		g_warning (G_STRLOC ": Unexpected response");
+		g_warning ("%s", G_STRLOC ": Unexpected response");
 		return NULL;
 	}
 
@@ -337,7 +337,7 @@
 e_calendar_remove_op (ECal *ecal, ECalendarOp *op)
 {
 	if (ecal->priv->current_op != op)
-		g_warning (G_STRLOC ": Cannot remove op, it's not current");
+		g_warning ("%s", G_STRLOC ": Cannot remove op, it's not current");
 
 	ecal->priv->current_op = NULL;
 }
@@ -361,7 +361,7 @@
 
 		result = CORBA_Object_is_nil (factory, &ev);
 		if (BONOBO_EX (&ev)) {
-			g_message (G_STRLOC ": could not see if a factory was nil");
+			g_message ("%s", G_STRLOC ": could not see if a factory was nil");
 			CORBA_exception_free (&ev);
 
 			continue;
@@ -372,7 +372,7 @@
 
 		CORBA_Object_release (factory, &ev);
 		if (BONOBO_EX (&ev)) {
-			g_message (G_STRLOC ": could not release a factory");
+			g_message ("%s", G_STRLOC ": could not release a factory");
 			CORBA_exception_free (&ev);
 		}
 	}
@@ -394,7 +394,7 @@
 	CORBA_exception_init (&ev);
 	result = CORBA_Object_is_nil (priv->cal, &ev);
 	if (BONOBO_EX (&ev)) {
-		g_message (G_STRLOC ": could not see if the "
+		g_message ("%s", G_STRLOC ": could not see if the "
 			   "calendar ecal interface object was nil");
 		priv->cal = CORBA_OBJECT_NIL;
 		CORBA_exception_free (&ev);
@@ -487,7 +487,7 @@
 	op = e_calendar_get_op (ecal);
 
 	if (op == NULL) {
-		g_warning (G_STRLOC ": Cannot find operation ");
+		g_warning ("%s", G_STRLOC ": Cannot find operation ");
 		return;
 	}
 
@@ -506,7 +506,7 @@
 	op = e_calendar_get_op (ecal);
 
 	if (op == NULL) {
-		g_warning (G_STRLOC ": Cannot find operation ");
+		g_warning ("%s", G_STRLOC ": Cannot find operation ");
 		return;
 	}
 
@@ -525,7 +525,7 @@
 	op = e_calendar_get_op (ecal);
 
 	if (op == NULL) {
-		g_warning (G_STRLOC ": Cannot find operation ");
+		g_warning ("%s", G_STRLOC ": Cannot find operation ");
 		return;
 	}
 
@@ -544,7 +544,7 @@
 	op = e_calendar_get_op (ecal);
 
 	if (op == NULL) {
-		g_warning (G_STRLOC ": Cannot find operation ");
+		g_warning ("%s", G_STRLOC ": Cannot find operation ");
 		return;
 	}
 
@@ -562,7 +562,7 @@
 	op = e_calendar_get_op (ecal);
 
 	if (op == NULL) {
-		g_warning (G_STRLOC ": Cannot find operation ");
+		g_warning ("%s", G_STRLOC ": Cannot find operation ");
 		return;
 	}
 
@@ -580,7 +580,7 @@
 	op = e_calendar_get_op (ecal);
 
 	if (op == NULL) {
-		g_warning (G_STRLOC ": Cannot find operation ");
+		g_warning ("%s", G_STRLOC ": Cannot find operation ");
 		return;
 	}
 



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