# HG changeset patch # User ranma # Date 1294324870 0 # Node ID fcd252bdedd0bb3aa43146e3c52612775e29037a # Parent c48020f894a225aa0847cca13968b7aaf97131c7 Don't hardcode filename length. Use limits.h to get the maximum length instead of hardcoding it. Original patch by Sang-Uok Kum. Signed-off-by: Tobias Diedrich diff -r c48020f894a2 -r fcd252bdedd0 libmpdemux/mf.c --- a/libmpdemux/mf.c Thu Jan 06 14:38:55 2011 +0000 +++ b/libmpdemux/mf.c Thu Jan 06 14:41:10 2011 +0000 @@ -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;