]> git.sesse.net Git - vlc/commitdiff
Don't use random number as pointers.
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 14 Feb 2010 09:55:50 +0000 (11:55 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 14 Feb 2010 09:55:50 +0000 (11:55 +0200)
This is not legal (even if it works on all platforms). Also, this fixes
a warning.

test/src/misc/variables.c

index e2524618da8642d59428dd4071a3043f321092d6..15e7fc5d0df865ecee61f43b1601b1ec3ad618e1 100644 (file)
@@ -154,13 +154,15 @@ static void test_strings( libvlc_int_t *p_libvlc )
 
 static void test_address( libvlc_int_t *p_libvlc )
 {
+    char dummy[i_var_count];
+
     int i;
     for( i = 0; i < i_var_count; i++ )
          var_Create( p_libvlc, psz_var_name[i], VLC_VAR_ADDRESS );
 
     for( i = 0; i < i_var_count; i++ )
     {
-        var_value[i].p_address = rand();
+        var_value[i].p_address = dummy + i;
         var_SetAddress( p_libvlc, psz_var_name[i], var_value[i].p_address );
     }