mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Perform some code cleanup
This commit is contained in:
parent
3e17c7b20f
commit
19d0c15e03
41 changed files with 321 additions and 459 deletions
|
@ -34,10 +34,12 @@
|
|||
* @note unlike strtok() this does empty tokens and is re-entrant
|
||||
*/
|
||||
char *strsep(char **str, const char *delim) {
|
||||
char *token = *str;
|
||||
size_t i;
|
||||
char *token, *next;
|
||||
token = *str;
|
||||
if (token) {
|
||||
size_t i = strcspn(token, delim);
|
||||
char *next = NULL;
|
||||
i = strcspn(token, delim);
|
||||
next = NULL;
|
||||
if (token[i]) {
|
||||
token[i] = '\0';
|
||||
next = &token[i + 1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue