From: Peter K. <pet...@ax...> - 2002-04-08 06:11:27
|
> -----Original Message----- > From: enl...@li... > [mailto:enl...@li...] > Sent: Sunday, April 07, 2002 22:46 > To: enl...@li... > Subject: E CVS: libs/imlib2 smugg > > > Enlightenment CVS committal > > Author : smugg > Project : e17 > Module : libs/imlib2 > > Dir : e17/libs/imlib2/filters > > > Modified Files: > filter_test.c > > > Log Message: > bad bad =) > > =================================================================== > RCS file: > /cvsroot/enlightenment/e17/libs/imlib2/filters/filter_test.c,v > retrieving revision 1.7 > retrieving revision 1.8 > diff -u -3 -r1.7 -r1.8 > --- filter_test.c 17 Sep 2000 03:07:45 -0000 1.7 > +++ filter_test.c 7 Apr 2002 20:46:26 -0000 1.8 > @@ -24,7 +24,7 @@ > info->author = strdup( "Chris Ross - Boris - ch...@da..." ); > info->description = strdup( "This filter is used to show that the imlib2 filter system works!" ); > info->num_filters = 3; > - info->filters = malloc(sizeof(char *)*2); > + info->filters = malloc(sizeof(char *)*3); And even more correct would probably be: info->num_filters = sizeof filters / sizeof *filters; info->filters = malloc(sizeof *info->filters * info->num_filters); Of course, this is only test code, but I see no reason not to make it correct because of that. Especially as this kind of code often serves as a template for further implementations. > for (i = 0; i < info->num_filters; i++) > info->filters[i] = strdup(filters[i]); //Peter |