Skip to content

Commit c60dfc9

Browse files
committed
Check if strsep() is not defined in the string.h included.
1 parent 5c75754 commit c60dfc9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

simavr/sim/sim_utils.c

+13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@
2727

2828
#include "sim_utils.h"
2929

30+
#ifndef strsep
31+
char *strsep(char **stringp, const char *delim) {
32+
char *rv = *stringp;
33+
if (rv) {
34+
*stringp += strcspn(*stringp, delim);
35+
if (**stringp)
36+
*(*stringp)++ = '\0';
37+
else
38+
*stringp = 0; }
39+
return rv;
40+
}
41+
#endif
42+
3043
static argv_p
3144
argv_realloc(
3245
argv_p argv,

0 commit comments

Comments
 (0)