Commit 25fccb94 authored by Rémi Duraffort's avatar Rémi Duraffort

Use strcmp instead of strncmp (the matching will be exact).

parent 1b447443
...@@ -345,40 +345,40 @@ static int MarqueeCallback( vlc_object_t *p_this, char const *psz_var, ...@@ -345,40 +345,40 @@ static int MarqueeCallback( vlc_object_t *p_this, char const *psz_var,
VLC_UNUSED(p_this); VLC_UNUSED(p_this);
vlc_mutex_lock( &p_sys->lock ); vlc_mutex_lock( &p_sys->lock );
if( !strncmp( psz_var, "marq-marquee", 12 ) ) if( !strcmp( psz_var, "marq-marquee" ) )
{ {
free( p_sys->psz_marquee ); free( p_sys->psz_marquee );
p_sys->psz_marquee = strdup( newval.psz_string ); p_sys->psz_marquee = strdup( newval.psz_string );
} }
else if ( !strncmp( psz_var, "marq-x", 6 ) ) else if ( !strcmp( psz_var, "marq-x" ) )
{ {
p_sys->i_xoff = newval.i_int; p_sys->i_xoff = newval.i_int;
} }
else if ( !strncmp( psz_var, "marq-y", 6 ) ) else if ( !strcmp( psz_var, "marq-y" ) )
{ {
p_sys->i_yoff = newval.i_int; p_sys->i_yoff = newval.i_int;
} }
else if ( !strncmp( psz_var, "marq-color", 10 ) ) else if ( !strcmp( psz_var, "marq-color" ) )
{ {
p_sys->p_style->i_font_color = newval.i_int; p_sys->p_style->i_font_color = newval.i_int;
} }
else if ( !strncmp( psz_var, "marq-opacity", 12 ) ) else if ( !strcmp( psz_var, "marq-opacity" ) )
{ {
p_sys->p_style->i_font_alpha = 255 - newval.i_int; p_sys->p_style->i_font_alpha = 255 - newval.i_int;
} }
else if ( !strncmp( psz_var, "marq-size", 9 ) ) else if ( !strcmp( psz_var, "marq-size" ) )
{ {
p_sys->p_style->i_font_size = newval.i_int; p_sys->p_style->i_font_size = newval.i_int;
} }
else if ( !strncmp( psz_var, "marq-timeout", 12 ) ) else if ( !strcmp( psz_var, "marq-timeout" ) )
{ {
p_sys->i_timeout = newval.i_int; p_sys->i_timeout = newval.i_int;
} }
else if ( !strncmp( psz_var, "marq-refresh", 12 ) ) else if ( !strcmp( psz_var, "marq-refresh" ) )
{ {
p_sys->i_refresh = newval.i_int * 1000; p_sys->i_refresh = newval.i_int * 1000;
} }
else if ( !strncmp( psz_var, "marq-position", 13 ) ) else if ( !strcmp( psz_var, "marq-position" ) )
/* willing to accept a match against marq-pos */ /* willing to accept a match against marq-pos */
{ {
p_sys->i_pos = newval.i_int; p_sys->i_pos = newval.i_int;
......
...@@ -571,7 +571,7 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var, ...@@ -571,7 +571,7 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var,
if( !p_sys ) if( !p_sys )
return VLC_SUCCESS; return VLC_SUCCESS;
if( !strncmp( psz_var, OSD_CFG"position", 16) ) if( !strcmp( psz_var, OSD_CFG"position") )
{ {
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
unsigned int i; unsigned int i;
...@@ -585,8 +585,8 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var, ...@@ -585,8 +585,8 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var,
} }
#undef ARRAY_SIZE #undef ARRAY_SIZE
} }
else if( !strncmp( psz_var, OSD_CFG"x", 9) || else if( !strcmp( psz_var, OSD_CFG"x") ||
!strncmp( psz_var, OSD_CFG"y", 9)) !strcmp( psz_var, OSD_CFG"y"))
{ {
p_sys->b_absolute = true; p_sys->b_absolute = true;
if( (p_sys->i_x < 0) || (p_sys->i_y < 0) ) if( (p_sys->i_x < 0) || (p_sys->i_y < 0) )
...@@ -601,11 +601,11 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var, ...@@ -601,11 +601,11 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var,
p_sys->p_menu->i_y = p_sys->i_y; p_sys->p_menu->i_y = p_sys->i_y;
} }
} }
else if( !strncmp( psz_var, OSD_CFG"update", 14) ) else if( !strcmp( psz_var, OSD_CFG"update") )
p_sys->i_update = newval.i_int * INT64_C(1000); p_sys->i_update = newval.i_int * INT64_C(1000);
else if( !strncmp( psz_var, OSD_CFG"timeout", 15) ) else if( !strcmp( psz_var, OSD_CFG"timeout") )
p_sys->i_update = newval.i_int % 1000; p_sys->i_update = newval.i_int % 1000;
else if( !strncmp( psz_var, OSD_CFG"alpha", 13) ) else if( !strcmp( psz_var, OSD_CFG"alpha") )
p_sys->i_alpha = newval.i_int % 256; p_sys->i_alpha = newval.i_int % 256;
p_sys->b_update = p_sys->b_visible ? true : false; p_sys->b_update = p_sys->b_visible ? true : false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment