Skip to content

Commit

Permalink
compat: Remove a needless strtok_r
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Aug 6, 2024
1 parent 1f9b002 commit 9e98f24
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions include/cmetrics/cmt_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,6 @@
#include <windows.h>
#endif

/* This function is copied from monkey/monkey.
https://github.com/monkey/monkey/blob/2567a70912ed7a68d9e75dca3cf22d3927fea99a/mk_core/deps/libevent/evdns.c#L3323 */
static inline char *
cmt_platform_strtok_r(char *s, const char *delim, char **state) {
char *cp, *start;
start = cp = s ? s : *state;
if (!cp)
return NULL;
while (*cp && !strchr(delim, *cp))
++cp;
if (!*cp) {
if (cp == start)
return NULL;
*state = NULL;
return start;
} else {
*cp++ = '\0';
*state = cp;
return start;
}
}

static inline struct tm *cmt_platform_gmtime_r(const time_t *timep, struct tm *result)
{
#ifdef CMT_HAVE_GMTIME_S
Expand Down

0 comments on commit 9e98f24

Please sign in to comment.