[winpr,crt] add return to ByteSwapUnicode

This commit is contained in:
Armin Novak 2023-12-12 11:20:54 +01:00 committed by akallabeth
parent 67f4dcabdc
commit 30494d0c93
2 changed files with 3 additions and 2 deletions

View File

@ -404,7 +404,7 @@ extern "C"
LPBOOL lpUsedDefaultChar));
#endif
WINPR_API void ByteSwapUnicode(WCHAR* wstr, size_t length);
WINPR_API const WCHAR* ByteSwapUnicode(WCHAR* wstr, size_t length);
WINPR_API size_t ConvertLineEndingToLF(char* str, size_t size);
WINPR_API char* ConvertLineEndingToCRLF(const char* str, size_t* size);

View File

@ -363,12 +363,13 @@ int ConvertFromUnicode(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int
* Swap Unicode byte order (UTF16LE <-> UTF16BE)
*/
void ByteSwapUnicode(WCHAR* wstr, size_t length)
const WCHAR* ByteSwapUnicode(WCHAR* wstr, size_t length)
{
WINPR_ASSERT(wstr || (length == 0));
for (size_t x = 0; x < length; x++)
wstr[x] = _byteswap_ushort(wstr[x]);
return wstr;
}
SSIZE_T ConvertWCharToUtf8(const WCHAR* wstr, char* str, size_t len)