]> git.sesse.net Git - vlc/commitdiff
* src/misc/net.c: WinCE fix.
authorGildas Bazin <gbazin@videolan.org>
Sun, 23 Oct 2005 16:24:30 +0000 (16:24 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 23 Oct 2005 16:24:30 +0000 (16:24 +0000)
src/misc/net.c

index a5b0820cb669e805d7c19db7e3308e41790703bc..4638383bf9c6ad0f906ba50fb9f6688fb50dc6f4 100644 (file)
@@ -1210,8 +1210,15 @@ int inet_pton(int af, const char *src, void *dst)
     int len = sizeof( addr );
 
     /* Damn it, they didn't even put LPCSTR for the firs parameter!!! */
+#ifdef UNICODE
+    wchar_t *workaround_for_ill_designed_api =
+        malloc( MAX_PATH * sizeof(wchar_t) );
+    mbstowcs( workaround_for_ill_designed_api, src, MAX_PATH );
+    workaround_for_ill_designed_api[MAX_PATH-1] = 0;
+#else
     char *workaround_for_ill_designed_api = strdup( src );
-    
+#endif
+
     if( !WSAStringToAddress( workaround_for_ill_designed_api, af, NULL,
                              (LPSOCKADDR)&addr, &len ) )
     {