[vlc-devel] commit: We don't need MB2WC when converting ASCII ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jan 10 14:07:06 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jan 10 15:06:21 2009 +0200| [50866663cd6e8fae6917ac6de10c1c4cd232c37d] | committer: Rémi Denis-Courmont 

We don't need MB2WC when converting ASCII

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

 src/modules/os.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

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




More information about the vlc-devel mailing list