[vlc-commits] input: fix variable shadowing

Rémi Denis-Courmont git at videolan.org
Sun Jul 23 13:46:33 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 23 14:25:19 2017 +0300| [7e6cda080f8f9ea841d092ecccccfe9e2f55a4ac] | committer: Rémi Denis-Courmont

input: fix variable shadowing

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

 src/input/subtitles.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/input/subtitles.c b/src/input/subtitles.c
index d3989337df..8b0952c1a0 100644
--- a/src/input/subtitles.c
+++ b/src/input/subtitles.c
@@ -217,7 +217,7 @@ int subtitles_Detect( input_thread_t *p_this, char *psz_path, const char *psz_na
     int i_fuzzy = var_GetInteger( p_this, "sub-autodetect-fuzzy" );
     if ( i_fuzzy == 0 )
         return VLC_EGENERIC;
-    int j, i_fname_len;
+    int i_fname_len;
     input_item_slave_t **pp_slaves = *ppp_slaves;
     int i_slaves = *p_slaves;
     char *f_fname_noext = NULL, *f_fname_trim = NULL;
@@ -265,7 +265,7 @@ int subtitles_Detect( input_thread_t *p_this, char *psz_path, const char *psz_na
     strcpy_trim( f_fname_trim, f_fname_noext );
 
     subdirs = paths_to_list( f_dir, psz_path );
-    for( j = -1; (j == -1) || ( j >= 0 && subdirs != NULL && subdirs[j] != NULL ); j++ )
+    for( int j = -1; (j == -1) || ( j >= 0 && subdirs != NULL && subdirs[j] != NULL ); j++ )
     {
         const char *psz_dir = (j < 0) ? f_dir : subdirs[j];
         if( psz_dir == NULL || ( j >= 0 && !strcmp( psz_dir, f_dir ) ) )
@@ -363,7 +363,7 @@ int subtitles_Detect( input_thread_t *p_this, char *psz_path, const char *psz_na
     }
     if( subdirs )
     {
-        for( j = 0; subdirs[j]; j++ )
+        for( size_t j = 0; subdirs[j] != NULL; j++ )
             free( subdirs[j] );
         free( subdirs );
     }



More information about the vlc-commits mailing list