[vlc-commits] Use strcmp instead of strncmp (the matching will be exact).

Rémi Duraffort git at videolan.org
Sun Feb 20 11:19:06 CET 2011


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Feb 20 11:18:09 2011 +0100| [25fccb94233bdf804dc6c364ca8121eab6dcfd9c] | committer: Rémi Duraffort

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=25fccb94233bdf804dc6c364ca8121eab6dcfd9c
---

 modules/video_filter/marq.c    |   18 +++++++++---------
 modules/video_filter/osdmenu.c |   12 ++++++------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/modules/video_filter/marq.c b/modules/video_filter/marq.c
index ddb98fd..44aae92 100644
--- a/modules/video_filter/marq.c
+++ b/modules/video_filter/marq.c
@@ -345,40 +345,40 @@ static int MarqueeCallback( vlc_object_t *p_this, char const *psz_var,
     VLC_UNUSED(p_this);
 
     vlc_mutex_lock( &p_sys->lock );
-    if( !strncmp( psz_var, "marq-marquee", 12 ) )
+    if( !strcmp( psz_var, "marq-marquee" ) )
     {
         free( p_sys->psz_marquee );
         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;
     }
-    else if ( !strncmp( psz_var, "marq-y", 6 ) )
+    else if ( !strcmp( psz_var, "marq-y" ) )
     {
         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;
     }
-    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;
     }
-    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;
     }
-    else if ( !strncmp( psz_var, "marq-timeout", 12 ) )
+    else if ( !strcmp( psz_var, "marq-timeout" ) )
     {
         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;
     }
-    else if ( !strncmp( psz_var, "marq-position", 13 ) )
+    else if ( !strcmp( psz_var, "marq-position" ) )
     /* willing to accept a match against marq-pos */
     {
         p_sys->i_pos = newval.i_int;
diff --git a/modules/video_filter/osdmenu.c b/modules/video_filter/osdmenu.c
index 9ca59a6..f5a134e 100644
--- a/modules/video_filter/osdmenu.c
+++ b/modules/video_filter/osdmenu.c
@@ -571,7 +571,7 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var,
     if( !p_sys )
         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]))
         unsigned int i;
@@ -585,8 +585,8 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var,
         }
 #undef ARRAY_SIZE
     }
-    else if( !strncmp( psz_var, OSD_CFG"x", 9) ||
-             !strncmp( psz_var, OSD_CFG"y", 9))
+    else if( !strcmp( psz_var, OSD_CFG"x") ||
+             !strcmp( psz_var, OSD_CFG"y"))
     {
         p_sys->b_absolute = true;
         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,
             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);
-    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;
-    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->b_update = p_sys->b_visible ? true : false;



More information about the vlc-commits mailing list