diff options
Diffstat (limited to 'util/strsep.c')
-rw-r--r-- | util/strsep.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/util/strsep.c b/util/strsep.c new file mode 100644 index 00000000..e54903ce --- /dev/null +++ b/util/strsep.c @@ -0,0 +1,11 @@ +#include <string.h> + +char *strsep(char **stringp, const char *delim) +{ + char *ret = *stringp; + if (ret == NULL) return NULL; + if ((*stringp = strpbrk(*stringp, delim)) != NULL) + *((*stringp)++) = '\0'; + return ret; +} + |