MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / strtok_r

Function strtok_r

libhb/compat.c:15–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include <string.h>
14
15char *strtok_r(char *s, const char *delim, char **save_ptr)
16{
17 char *token;
18
19 if (s == NULL) s = *save_ptr;
20
21 /* Scan leading delimiters. */
22 s += strspn(s, delim);
23 if (*s == '\0') return NULL;
24
25 /* Find the end of the token. */
26 token = s;
27 s = strpbrk(token, delim);
28 if (s == NULL)
29 {
30 /* This token finishes the string. */
31 *save_ptr = strchr(token, '\0');
32 }
33 else
34 {
35 /* Terminate the token and make *save_ptr point past it. */
36 *s = '\0';
37 *save_ptr = s + 1;
38 }
39
40 return token;
41}
42#endif // HB_NEED_STRTOK_R
43
44#ifndef HAS_STRERROR_R

Callers 3

hb_display_job_infoFunction · 0.85
ghb_preset_to_settingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected