mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 17:14:32 +00:00
[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:
parent
f6aaf58005
commit
761db77da5
2 changed files with 6 additions and 0 deletions
|
@ -18,7 +18,10 @@ char * CDECL strtok_s(char *str, const char *delim, char **ctx)
|
||||||
while(*str && strchr(delim, *str))
|
while(*str && strchr(delim, *str))
|
||||||
str++;
|
str++;
|
||||||
if(!*str)
|
if(!*str)
|
||||||
|
{
|
||||||
|
*ctx = str;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
*ctx = str+1;
|
*ctx = str+1;
|
||||||
while(**ctx && !strchr(delim, **ctx))
|
while(**ctx && !strchr(delim, **ctx))
|
||||||
|
|
|
@ -1930,7 +1930,10 @@ char* strtok_s(char *str, const char *delim, char **ctx)
|
||||||
while (*str && strchr(delim, *str))
|
while (*str && strchr(delim, *str))
|
||||||
str++;
|
str++;
|
||||||
if (!*str)
|
if (!*str)
|
||||||
|
{
|
||||||
|
*ctx = str;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
*ctx = str + 1;
|
*ctx = str + 1;
|
||||||
while (**ctx && !strchr(delim, **ctx))
|
while (**ctx && !strchr(delim, **ctx))
|
||||||
|
|
Loading…
Reference in a new issue