From 6bd0bafd0d2a28666be39511143b7928123da09c Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 10 May 2026 11:55:55 +0200 Subject: Fix a wrong use of strtok_r --- src/sp_config_utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sp_config_utils.c b/src/sp_config_utils.c index 84b1f30..415e434 100644 --- a/src/sp_config_utils.c +++ b/src/sp_config_utils.c @@ -11,8 +11,9 @@ sp_list_node *parse_functions_list(const char *const value) { sp_list_node *list = NULL; char *tmp = strdup(value); const char *function_name; - char *next_token = tmp; - while ((function_name = strtok_r(NULL, sep, &next_token))) { + char *next_token = NULL; + for (function_name = strtok_r(tmp, sep, &next_token); function_name; + function_name = strtok_r(NULL, sep, &next_token)) { list = sp_list_prepend(list, strdup(function_name)); } free(tmp); -- cgit v1.3