strsep.c\string\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/string/strsep.c
blob: cb37c32eb852b9318c40d1feb5f9259660f13b71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#define _GNU_SOURCE
#include <string.h>
char *strsep(char **str, const char *sep)
{
	char *s = *str, *end;
	if (!s) return NULL;
	end = s + strcspn(s, sep);
	if (*end) *end++ = 0;
	else end = 0;
	*str = end;
	return s;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月05日 04:21:56 +0000

AltStyle によって変換されたページ (->オリジナル) /