Enlightenment CVS committal Author : sebastid Project : e17 Module : libs/eet
Dir : e17/libs/eet/src/lib Modified Files: eet_lib.c Log Message: remove strdup =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/eet/src/lib/eet_lib.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- eet_lib.c 4 Nov 2005 17:44:01 -0000 1.51 +++ eet_lib.c 4 Nov 2005 18:29:02 -0000 1.52 @@ -979,19 +979,14 @@ } if (!exists_already) { - efn = calloc(1, sizeof(Eet_File_Node)); + efn = malloc(sizeof(Eet_File_Node) + strlen(name) + 1); if (!efn) { free(data2); return 0; } - efn->name = strdup(name); - if (!efn->name) - { - free(efn); - free(data2); - return 0; - } + efn->name = (char *)efn + sizeof(Eet_File_Node); + strcpy(efn->name, name); efn->next = ef->header->directory->nodes[hash]; ef->header->directory->nodes[hash] = efn; efn->offset = 0; @@ -1032,7 +1027,6 @@ if (eet_string_match(efn->name, name)) { if (efn->data) free(efn->data); - if (efn->name) free(efn->name); if (efn == ef->header->directory->nodes[hash]) ef->header->directory->nodes[hash] = efn->next; else ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs