1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-12-10 12:11:39 +03:00

Remove all references to strtok() and wcstok(), implement and use alternatives

strtok() and wcstok() are considered unsafe functions.

A segmentation fault caused by the use of strtok() was recently reported.

Co-authored-by: Takuho NAKANO <takotakot@users.noreply.github.com>
This commit is contained in:
Daiyuu Nobori
2020-07-20 17:53:45 +02:00
committed by Davide Beatrici
parent 3baf4674e7
commit 844dcdb0af
3 changed files with 169 additions and 122 deletions

View File

@ -101,6 +101,11 @@ bool UniInStrEx(wchar_t *str, wchar_t *keyword, bool case_sensitive);
void ClearUniStr(wchar_t *str, UINT str_size);
bool UniInChar(wchar_t *string, wchar_t c);
UNI_TOKEN_LIST *UniGetLines(wchar_t *str);
wchar_t *UniDefaultTokenSplitChars();
bool UniIsCharInStr(wchar_t *str, wchar_t c);
UNI_TOKEN_LIST *UniParseTokenWithNullStr(wchar_t *str, wchar_t *split_chars);
UNI_TOKEN_LIST *UniParseTokenWithoutNullStr(wchar_t *str, wchar_t *split_chars);
#ifdef OS_UNIX
void GetCurrentCharSet(char *name, UINT size);