commit 0d1b64188eeb3140196da29d0592bafb20c94996 parent 0d8748e79d0f5a30d1f6c4d5b63bdeaeeebba8be Author: Yersa Nordman <yersa@finwo.nl> Date: Sun, 18 Feb 2024 23:36:53 +0100 Using strtok instead of strtok_r for windows compatibility Diffstat:
| M | src/http-server.c | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/http-server.c b/src/http-server.c @@ -49,10 +49,10 @@ char ** _hs_pathTokens(const char *path) { int token_count = 0; char *dupped = strdup(path); - char *rest = dupped; - char *token; - while((token = strtok_r(rest, "/", &rest))) { + char *token = strtok(dupped, "/"); + while(token != NULL) { output[token_count++] = strdup(token); + token = strtok(NULL, "/"); } free(dupped);