UTF16ToWstring: stop at NUL input terminator.

This commit is contained in:
Alex Shvartzkop 2023-07-25 00:21:55 +03:00
parent 6cb804228b
commit b784b44ed0
1 changed files with 3 additions and 0 deletions

View File

@ -113,6 +113,9 @@ std::wstring UTF16ToWstring(const T* u16, size_t len = 0)
size_t pos = 0;
while( GetNextCodePointFromUTF16( u16, len, &pos, &cp ) )
{
if( !cp )
break;
ret += cp;
}
}