libwinpr-crt: add strtok_s

This commit is contained in:
Marc-André Moreau 2012-07-30 15:21:57 -04:00
parent dbd6149e01
commit 39ce1596f7
3 changed files with 9 additions and 2 deletions

View File

@ -49,6 +49,8 @@ WINPR_API WCHAR* _wcsdup(const WCHAR* strSource);
WINPR_API int _stricmp(const char* string1, const char* string2);
WINPR_API char* strtok_s(char* strToken, const char* strDelimit, char** context);
WINPR_API LPSTR CharUpperA(LPSTR lpsz);
WINPR_API LPWSTR CharUpperW(LPWSTR lpsz);

View File

@ -70,6 +70,11 @@ int _stricmp(const char* string1, const char* string2)
return strcasecmp(string1, string2);
}
char* strtok_s(char* strToken, const char* strDelimit, char** context)
{
return strtok_r(strToken, strDelimit, context);
}
/* Windows API Sets - api-ms-win-core-string-l2-1-0.dll
* http://msdn.microsoft.com/en-us/library/hh802935/
*/

View File

@ -205,7 +205,7 @@ void reg_insert_key(Reg* reg, RegKey* key, RegKey* subkey)
path = _strdup(subkey->name);
name = strtok_r(path, "\\", &save);
name = strtok_s(path, "\\", &save);
while (name != NULL)
{
@ -216,7 +216,7 @@ void reg_insert_key(Reg* reg, RegKey* key, RegKey* subkey)
subkey->subname = _strdup(name);
}
name = strtok_r(NULL, "\\", &save);
name = strtok_s(NULL, "\\", &save);
}
free(path);