forked from Vhex-Kernel-Core/fxlibc
string: fix strtok detecting NUL only after separators
This commit is contained in:
parent
ea35c18c41
commit
a0ceeefaf4
|
@ -12,7 +12,7 @@ char *strtok(char * restrict new_s, char const * restrict separators)
|
|||
/* Skip non-delimiters */
|
||||
char *token = s;
|
||||
s += strcspn(s, separators);
|
||||
*s++ = 0;
|
||||
if(*s) *s++ = 0;
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue