| 150 | } |
| 151 | |
| 152 | char *strtok_r(char *str, const char *delim, char **ptr) |
| 153 | { |
| 154 | char *start; |
| 155 | char *end; |
| 156 | |
| 157 | if (str == NULL) |
| 158 | str = *ptr; |
| 159 | start = str + strspn(str, delim); |
| 160 | if (start[0] == '\0') |
| 161 | return NULL; |
| 162 | |
| 163 | end = start + strcspn(start, delim); |
| 164 | *ptr = end; |
| 165 | if (end[0] != '\0') |
| 166 | *(*ptr)++ = '\0'; |
| 167 | return start; |
| 168 | } |
| 169 | |
| 170 | char *strtok(char *str, const char *delim) |
| 171 | { |
no test coverage detected