[vlc-devel] [PATCH 09/13] lib/vlm: narrow scope of variables used in loop

Filip Roséen filip at atch.se
Wed Oct 12 20:08:08 CEST 2016


---
 lib/vlm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/vlm.c b/lib/vlm.c
index aecfca6..52aad85 100644
--- a/lib/vlm.c
+++ b/lib/vlm.c
@@ -196,9 +196,8 @@ static char* recurse_answer( vlm_message_t *p_answer, const char* psz_delim,
     char* psz_childdelim = NULL;
     char* psz_nametag = NULL;
     char* psz_response = strdup( "" );
-    char *psz_tmp;
     int i_success = 0;
-    int i;
+
     vlm_message_t *aw_child, **paw_child;
 
     i_success = asprintf( &psz_childdelim, "%s\t", psz_delim);
@@ -208,8 +207,9 @@ static char* recurse_answer( vlm_message_t *p_answer, const char* psz_delim,
     paw_child = p_answer->child;
     aw_child = *( paw_child );
     /* Iterate over children */
-    for( i = 0; i < p_answer->i_child; i++ )
+    for( int i = 0; i < p_answer->i_child; i++ )
     {
+        char *psz_tmp;
         /* Spare comma if it is the last element */
         char c_comma = ',';
         if( i == (p_answer->i_child - 1) )
-- 
2.10.0



More information about the vlc-devel mailing list