RE: [AD] Some points about the grabber |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
> > /* 80 characters * maximum character width (6 bytes for UTF8) */
> > #define FILENAME_LENGTH (80*6)
>
> This should be PATH_MAX * 6 (defined in limits.h)
There are a load of tiny hardcoded buffer sizes in Allegro that
really ought to go. I vote for any patch that removes them. And
if not practical, to add error codes whenever something gets
truncated, so at least the caller knows the operation did not
go well.
BTW, PATH_MAX sometimes is less than the actual PATH_MAX, as it
would sometimes be huge (and declaring huge automatic arrays on
the stack is not a good thing). I saw that somewhere in the glibc
docs some time ago. I guess it's rather safer than 80 though :)
--
Vincent Penquerc'h
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |