From 1c37a03ac6cdf7243e3781eef9c8beae777c1040 Mon Sep 17 00:00:00 2001 From: ranma Date: Thu, 6 Jan 2011 14:41:10 +0000 Subject: [PATCH] libmpdemux/mf.c: 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 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32766 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/mf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmpdemux/mf.c b/libmpdemux/mf.c index c8d64313b0..3127176f6e 100644 --- a/libmpdemux/mf.c +++ b/libmpdemux/mf.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -62,8 +63,8 @@ mf_t* open_mf(char * filename){ 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;