> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of [EMAIL PROTECTED] > Sent: Sunday, July 25, 2004 06:03 > To: [EMAIL PROTECTED] > Subject: E CVS: libs/etox vacuum > > Enlightenment CVS committal > > Author : vacuum > Project : e17 > Module : libs/etox > > Dir : e17/libs/etox/src/style > > > Modified Files: > etox_style_style.c > > > Log Message: > sprintf->snprintf > > =================================================================== > RCS file: > /cvsroot/enlightenment/e17/libs/etox/src/style/etox_style_style.c,v > retrieving revision 1.2 > retrieving revision 1.3 > diff -u -3 -r1.2 -r1.3 > --- etox_style_style.c 11 Jun 2004 14:19:05 -0000 1.2 > +++ etox_style_style.c 25 Jul 2004 04:03:00 -0000 1.3 > @@ -733,36 +733,36 @@ > layer = (Etox_Style_Style_Layer *)calloc(sizeof(Etox_Style_Style_Layer), > 1); > > - sprintf(key, "/layers/%d/stack", i); > + snprintf(key, sizeof(key)-1, "/layers/%d/stack", i); > e_db_int_get(info->style_db, key, &layer->stack); > > - sprintf(key, "/layers/%d/size_change", i); > + snprintf(key, sizeof(key)-1, "/layers/%d/size_change", i); > e_db_int_get(info->style_db, key, &layer->size_change);
[snip] Why 'sizeof(key)-1'? Why not 'sizeof key'? The size argument to snprintf() should include the space needed for the terminating NUL character. //Peter ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idG21&alloc_id040&op=click _______________________________________________ enlightenment-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel