move msghdr and cmsghdr out of bits/socket.h
[musl.git] / src / string / strsep.c
blobcb37c32eb852b9318c40d1feb5f9259660f13b71
1 #define _GNU_SOURCE
2 #include <string.h>
4 char *strsep(char **str, const char *sep)
6 char *s = *str, *end;
7 if (!s) return NULL;
8 end = s + strcspn(s, sep);
9 if (*end) *end++ = 0;
10 else end = 0;
11 *str = end;
12 return s;