From: RĂ©mi Denis-Courmont Date: Wed, 21 May 2008 19:07:22 +0000 (+0300) Subject: Don't rely on scanf when parsing floats from files X-Git-Tag: 0.9.0-test0~828 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a2c338bb861ca781457ae23c8a36215a6ce82ea6;p=vlc Don't rely on scanf when parsing floats from files (well, you _can_ but you'd need to use uselocale() then) --- diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c index f65575f31f..d1e142f688 100644 --- a/modules/demux/subtitle.c +++ b/modules/demux/subtitle.c @@ -1468,8 +1468,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) free( psz_temp ); } /* Data Lines */ - if( sscanf (s, "%f %f", &f1, &f2 ) == 2 ) + f1 = us_strtod( s, &psz_temp ); + if( *psz_temp ) { + f2 = us_strtod( psz_temp, NULL ); mpsub_total += f1 * mpsub_factor; p_subtitle->i_start = (int64_t)(10000.0 * mpsub_total); mpsub_total += f2 * mpsub_factor;