Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin Modified Files: ewl_theme_test.c Log Message: Use snprintf to be a more portable. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_theme_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_theme_test.c 4 May 2005 17:25:21 -0000 1.1 +++ ewl_theme_test.c 4 May 2005 18:00:34 -0000 1.2 @@ -357,14 +357,18 @@ len = strlen (name); if ((len >= 4) && (strcmp (name + len - 4, ".edj") == 0)) { char *str; - - str = strndup (name, len - 4); - row = ewl_tree_text_row_add (EWL_TREE (list), NULL, &str); - ewl_callback_append (row, - EWL_CALLBACK_CLICKED, - EWL_CALLBACK_FUNCTION (__select_theme), - NULL); - free (str); + + str = malloc(len - 3); + if (str) { + snprintf(str, len - 3, "%s", name); + row = ewl_tree_text_row_add(EWL_TREE (list), + NULL, &str); + ewl_callback_append(row, + EWL_CALLBACK_CLICKED, + EWL_CALLBACK_FUNCTION(__select_theme), + NULL); + free (str); + } } } ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs