On Thu, Dec 9, 2010 at 11:24 AM, Vincent Torri <vto...@univ-evry.fr> wrote: > On Thu, 9 Dec 2010, Gustavo Sverzut Barbieri wrote: >> On Thu, Dec 9, 2010 at 12:55 AM, Enlightenment SVN >> <no-re...@enlightenment.org> wrote: >>> >>> Log: >>> and if i'm breaking shit... i may as well put it at the end, so if >>> size changes later to be bigger, existing code doesnt break (due to >>> the way this is meant to be accessed). >> >>> size_t path_length; /**< size of the whole path */ >>> size_t name_length; /**< size of the filename/basename >>> component */ >>> size_t name_start; /**< where the filename/basename >>> component starts */ >>> + Eina_File_Type type; /**< file type */ >>> char path[EINA_PATH_MAX]; /**< the path */ >>> - Eina_File_Type type; /**< file type */ >> >> that's it! the actual value from PATH_MAX shouldn't matter as it's >> filled in the code, users should trust it's \0 terminated and size of >> name_length. >> >> HOWEVER, you did not update eina_file.c to use EINA_PATH_MAX, it's >> still using PATH_MAX that may be bigger than EINA_PATH_MAX (although >> it matches in most systems) > > why not something like > char path[1]; > and allocating the memory ? (with path at the end, it's possible)
Because the current code doesn't do any allocation and we want to limit allocation. -- Cedric BAIL ------------------------------------------------------------------------------ This SF Dev2Dev email is sponsored by: WikiLeaks The End of the Free Internet http://p.sf.net/sfu/therealnews-com _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel