Re: [evolution-patches] Fix for saving alarm info in the GW server



hi,

0 is the intended value for initialization.. the comparison must be
against 0 and not -1.
modified the code to use g_strdup_printf :)

Committed the changes.

thanks,
harish


On Tue, 2004-04-27 at 17:03, Rodrigo Moya wrote:
> On Tue, 2004-04-27 at 12:21 +0530, Harish Krishnaswamy wrote:
> > hi, 
> 
> > @@ -285,6 +286,7 @@ e_gw_item_init (EGwItem *item, EGwItemCl
> >  	priv->start_date = -1;
> >  	priv->end_date = -1;
> >  	priv->due_date = -1;
> > +	priv->trigger = 0;
> >
> here, you should probably set it to -1, given that you check for that
> value below.
> 
> > +		if (priv->trigger != -1) {
> > +			alarm = g_malloc (5); 
> > +			/* 5 is the max length required as GW does allows values upto
> > 12*60*60 only*/
> > +			sprintf (alarm, "%d", priv->trigger);
> >
> here, it's better to use g_strdup_printf instead of g_malloc+sprintf.
> 
> the rest looks ok
> 
> cheers
> 



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