Perform some code cleanup

This commit is contained in:
Justine Tunney 2021-02-27 10:33:32 -08:00
parent 3e17c7b20f
commit 19d0c15e03
41 changed files with 321 additions and 459 deletions

View file

@ -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];