Browse Source

string: fix strtok detecting NUL only after separators

master 1.2.1
Lephenixnoir 5 months ago
parent
commit
a0ceeefaf4
Signed by: Lephenixnoir GPG Key ID: 1BBA026E13FC0495
  1. 2
      src/libc/string/strtok.c

2
src/libc/string/strtok.c

@ -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…
Cancel
Save