Enlightenment CVS committal Author : sndev Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x Modified Files: ecore_x_icccm.c Log Message: * use calloc instead of malloc * set *argc = 0 if mem for the *argv cannot be allocated. =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_icccm.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -3 -r1.43 -r1.44 --- ecore_x_icccm.c 8 Jun 2006 20:03:42 -0000 1.43 +++ ecore_x_icccm.c 10 Jun 2006 16:54:36 -0000 1.44 @@ -752,8 +752,12 @@ if (argc) *argc = c; if (argv) { - (*argv) = malloc(c); - if (!*argv) return; + (*argv) = calloc(c, sizeof(char *)); + if (!*argv) + { + *argc = 0; + return; + } for (i = 0; i < c; i++) (*argv)[i] = strdup(v[i]); } _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs