[winpr,crt] fix wcstok_s

This commit is contained in:
Armin Novak 2023-12-12 13:09:34 +01:00 committed by akallabeth
parent 9575f386cd
commit 5b0ee107bf

View File

@ -413,24 +413,24 @@ WCHAR* wcstok_s(WCHAR* strToken, const WCHAR* strDelimit, WCHAR** context)
if (!strToken)
strToken = *context;
Data_Read_UINT16(strToken, value);
value = *strToken;
while (*strToken && _wcschr(strDelimit, value))
{
strToken++;
Data_Read_UINT16(strToken, value);
value = *strToken;
}
if (!*strToken)
return NULL;
nextToken = strToken++;
Data_Read_UINT16(strToken, value);
value = *strToken;
while (*strToken && !(_wcschr(strDelimit, value)))
{
strToken++;
Data_Read_UINT16(strToken, value);
value = *strToken;
}
if (*strToken)