diff options
| author | Thibault "bui" Koechlin | 2017-12-28 17:04:06 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-28 17:04:06 +0100 |
| commit | 9f5e8d12f05fb24c915a5266a1e908a75c8aed08 (patch) | |
| tree | 9160075ea943c7fd29a3923f844a0ac0d6b8b457 /src/sp_config_utils.c | |
| parent | 62c48bf9a85e0294b7b32cea438e904e1cd50669 (diff) | |
Clang-format pass
- `clang-format --style="{BasedOnStyle: google, SortIncludes: false}" -i snuffleu*.c sp_*.c sp_*.h`
- Update the documentation accordingly
Diffstat (limited to 'src/sp_config_utils.c')
| -rw-r--r-- | src/sp_config_utils.c | 14 |
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 | ||
| 35 | char *get_param(size_t *consumed, char *restrict line, sp_type type, | 35 | char *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 | } |
| 87 | err: | 87 | err: |
| 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)); |
