diff --git a/src/libc/string/strtok.c b/src/libc/string/strtok.c index 11d81d3..a60f794 100644 --- a/src/libc/string/strtok.c +++ b/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; }