Use limits.h to get the maximum length instead of hardcoding it. Original patch by Sang-Uok Kum. Signed-off-by: Tobias Diedrich Index: mplayer-patchset1/libmpdemux/mf.c =================================================================== --- mplayer-patchset1.orig/libmpdemux/mf.c 2010-12-21 20:05:53.375548000 +0100 +++ mplayer-patchset1/libmpdemux/mf.c 2010-12-21 20:43:53.699417000 +0100 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -63,8 +64,8 @@ FILE *lst_f=fopen(filename + 1,"r"); if ( lst_f ) { - fname=malloc( 255 ); - while ( fgets( fname,255,lst_f ) ) + fname=malloc(PATH_MAX); + while ( fgets( fname,PATH_MAX,lst_f ) ) { /* remove spaces from end of fname */ char *t=fname + strlen( fname ) - 1;