[vlc-devel] [PATCH] Fix sizeof misuse and variable uninitialization

Pierre Ynard linkfanel at yahoo.fr
Tue Jan 13 15:14:22 CET 2009


Fix sizeof misuse and variable uninitialization. Unbreaks start-up on
WinCE.


diff --git a/src/modules/os.c b/src/modules/os.c
index ca0e214..d1d8384 100644
--- a/src/modules/os.c
+++ b/src/modules/os.c
@@ -321,8 +321,8 @@ static void *module_Lookup( module_handle_t handle, const char *psz_function )
     }
 
 #elif defined(HAVE_DL_WINDOWS) && defined(UNDER_CE)
-    wchar_t wide[sizeof( psz_function ) + 1];
-    size_t i;
+    wchar_t wide[strlen( psz_function ) + 1];
+    size_t i = 0;
     do
         wide[i] = psz_function[i]; /* UTF-16 <- ASCII */
     while( psz_function[i++] );


Regards,

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the vlc-devel mailing list