winpr-crt: Fixed compilation errors in _wcsdup on Android
authorMartin Fleisz <mfleisz@thinstuff.com>
Wed, 4 Jul 2012 10:28:04 +0000 (03:28 -0700)
committerMartin Fleisz <mfleisz@thinstuff.com>
Wed, 4 Jul 2012 10:28:04 +0000 (03:28 -0700)
winpr/crt/string.c

index 5415bb5..920b586 100644 (file)
@@ -50,11 +50,11 @@ WCHAR* _wcsdup(const WCHAR* strSource)
 
 #if sun
        strDestination = wsdup(strSource);
-#elif defined(__APPLE__) && defined(__MACH__)
-       strDestination = malloc(wcslen(strSource));
+#elif defined(__APPLE__) && defined(__MACH__) || defined(ANDROID)
+       strDestination = malloc(wcslen((wchar_t*)strSource));
 
        if (strDestination != NULL)
-               wcscpy(strDestination, strSource);
+               wcscpy((wchar_t*)strDestination, (const wchar_t*)strSource);
 #else
        strDestination = (WCHAR*) wcsdup((wchar_t*) strSource);
 #endif