X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/3903760236c30e3b5ace7a4eefac3a269d68957c..eb6b6ca394357805f2bdba989abae309f718b4d8:/bsd/libkern/strsep.c diff --git a/bsd/libkern/strsep.c b/bsd/libkern/strsep.c index 6e0942254..3c4c13c7e 100644 --- a/bsd/libkern/strsep.c +++ b/bsd/libkern/strsep.c @@ -83,19 +83,21 @@ strsep(char **stringp, const char *delim) int c, sc; char *tok; - if ((s = *stringp) == NULL) - return (NULL); + if ((s = *stringp) == NULL) { + return NULL; + } for (tok = s;;) { c = *s++; spanp = delim; do { if ((sc = *spanp++) == c) { - if (c == 0) + if (c == 0) { s = NULL; - else + } else { s[-1] = 0; + } *stringp = s; - return (tok); + return tok; } } while (sc != 0); }