[CDMAKE][CTR] Fix strtok_s for empty strings. Part of Wine commit 4fa616c by Bernhard...
[reactos.git] / reactos / sdk / lib / crt / string / strtok_s.c
index 46a06cd..6e8b560 100644 (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))