summaryrefslogtreecommitdiff
path: root/src/sp_config_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_config_utils.c')
-rw-r--r--src/sp_config_utils.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sp_config_utils.c b/src/sp_config_utils.c
index bf558d4..20d4d79 100644
--- a/src/sp_config_utils.c
+++ b/src/sp_config_utils.c
@@ -26,14 +26,14 @@ int parse_keywords(sp_config_functions *funcs, char *line) {
26 26
27 if (*line) { 27 if (*line) {
28 sp_log_err("config", "Trailing chars '%s' at the end of '%s' on line %zu.", 28 sp_log_err("config", "Trailing chars '%s' at the end of '%s' on line %zu.",
29 line, original_line, sp_line_no); 29 line, original_line, sp_line_no);
30 return -1; 30 return -1;
31 } 31 }
32 return 0; 32 return 0;
33} 33}
34 34
35char *get_param(size_t *consumed, char *restrict line, sp_type type, 35char *get_param(size_t *consumed, char *restrict line, sp_type type,
36 const char *restrict keyword) { 36 const char *restrict keyword) {
37 enum { IN_ESCAPE, NONE } state = NONE; 37 enum { IN_ESCAPE, NONE } state = NONE;
38 char *original_line = line; 38 char *original_line = line;
39 size_t j = 0; 39 size_t j = 0;
@@ -86,10 +86,12 @@ char *get_param(size_t *consumed, char *restrict line, sp_type type,
86 } 86 }
87err: 87err:
88 if (0 == j) { 88 if (0 == j) {
89 sp_log_err("error", "A valid string as parameter is expected on line %zu.", sp_line_no); 89 sp_log_err("error", "A valid string as parameter is expected on line %zu.",
90 sp_line_no);
90 } else { 91 } else {
91 sp_log_err("error", 92 sp_log_err("error",
92 "There is an issue with the parsing of '%s': it doesn't look like a valid string on line %zu.", 93 "There is an issue with the parsing of '%s': it doesn't look "
94 "like a valid string on line %zu.",
93 original_line ? original_line : "NULL", sp_line_no); 95 original_line ? original_line : "NULL", sp_line_no);
94 } 96 }
95 line = NULL; 97 line = NULL;
@@ -104,8 +106,8 @@ zend_always_inline sp_list_node *parse_functions_list(char *value) {
104 } 106 }
105 107
106 sp_list_node *list = sp_list_new(); 108 sp_list_node *list = sp_list_new();
107 char* tmp = strdup(value); 109 char *tmp = strdup(value);
108 char* function_name; 110 char *function_name;
109 char *next_token = tmp; 111 char *next_token = tmp;
110 while ((function_name = strtok_r(NULL, sep, &next_token))) { 112 while ((function_name = strtok_r(NULL, sep, &next_token))) {
111 sp_list_prepend(list, strdup(function_name)); 113 sp_list_prepend(list, strdup(function_name));