[CDMAKE][CTR] Fix strtok_s for empty strings. Part of Wine commit 4fa616c by Bernhard Übelacker.

svn path=/trunk/; revision=72406
This commit is contained in:
Amine Khaldi 2016-08-21 16:30:06 +00:00
parent f6aaf58005
commit 761db77da5
2 changed files with 6 additions and 0 deletions

View file

@ -18,7 +18,10 @@ char * CDECL strtok_s(char *str, const char *delim, char **ctx)
while(*str && strchr(delim, *str))
str++;
if(!*str)
{
*ctx = str;
return NULL;
}
*ctx = str+1;
while(**ctx && !strchr(delim, **ctx))

View file

@ -1930,7 +1930,10 @@ char* strtok_s(char *str, const char *delim, char **ctx)
while (*str && strchr(delim, *str))
str++;
if (!*str)
{
*ctx = str;
return NULL;
}
*ctx = str + 1;
while (**ctx && !strchr(delim, **ctx))