[MPlayer-dev-eng] [patch 2/5] Dont hardcode filename length
auerswal at unix-ag.uni-kl.de
Wed Jan 5 11:43:51 CET 2011
On Tue, Jan 04, 2011 at 09:35:03PM +0100, Tobias Diedrich wrote:
> Use limits.h to get the maximum length instead of hardcoding it.
> - fname=malloc( 255 );
> - while ( fgets( fname,255,lst_f ) )
> + fname=malloc(PATH_MAX);
> + while ( fgets( fname,PATH_MAX,lst_f ) )
FWIW there is no guarantee that PATH_MAX even exists. See e.g.
I'd thus suggest a configure check for PATH_MAX and providing some
arbitrary fallback value, e.g. 255 as used currently(?).
In the beginning, there were not enough colors.
-- Guy Keren
More information about the MPlayer-dev-eng