Commit 831562a5 authored by Gildas Bazin's avatar Gildas Bazin

* src/misc/net.c: WinCE fix.

parent db2eed2d
...@@ -1210,8 +1210,15 @@ int inet_pton(int af, const char *src, void *dst) ...@@ -1210,8 +1210,15 @@ int inet_pton(int af, const char *src, void *dst)
int len = sizeof( addr ); int len = sizeof( addr );
/* Damn it, they didn't even put LPCSTR for the firs parameter!!! */ /* 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 ); char *workaround_for_ill_designed_api = strdup( src );
#endif
if( !WSAStringToAddress( workaround_for_ill_designed_api, af, NULL, if( !WSAStringToAddress( workaround_for_ill_designed_api, af, NULL,
(LPSOCKADDR)&addr, &len ) ) (LPSOCKADDR)&addr, &len ) )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment