Browse Source

fixed strtok bug

master
Mathieu Serandour 11 months ago
parent
commit
f1d6c68d8c
  1. 6
      kernel/lib/string.c

6
kernel/lib/string.c

@ -300,7 +300,11 @@ char* strtok_r(char* restrict str, const char* restrict delim, char** restrict s
if(!next) {
*saveptr = NULL;
return ptr;
if(! *ptr) // reached the end
return NULL;
else
return ptr;
}
else if(next == ptr) {
ptr++;

Loading…
Cancel
Save