On 12/23/2009 06:14 PM, Christopher Michael wrote: > On 12/23/2009 06:01 PM, Vincent Torri wrote: >> >> >> On Wed, 23 Dec 2009, Enlightenment SVN wrote: >> >>> Log: >>> When using snprintf or fgets, etc, do not use PATH_MAX directly as the >>> size >>> of the variable...use sizeof() compiler directive (lots of these). >> >> that's something i don't understand. >> >> char buf[PATH_MAX] is an array of size PATH_MAX in bytes >> and sizeof(buf) returns the size of buf in bytes, which is also PATH_MAX >> >> so what is the interest of using sizeof() instead of PATH_MAX ? >> >> Vincent > > A little while ago I had changed snprintf's in several spots todo just > that...PATH_MAX rather than sizeof()...raster suggested against it and > had a valid reason (can't remember it now, but if you grep the mailing > list archives I am sure you will find the discussion) > > dh > Also, doing sizeof() is a compiler directive so does not incur any performance hits...plus it matches the rest of EFL.
dh ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel