diff options
-rw-r--r-- | src/map.c | 17 | ||||
-rw-r--r-- | src/map.h | 3 |
2 files changed, 11 insertions, 9 deletions
@@ -840,17 +840,19 @@ map_data_set_entry(struct plugin_state *state, const char *domain_name, const char *map_name, const char *id, - unsigned int n_keys, - unsigned int *key_lens, + unsigned int *key_lengths, char **keys, unsigned int value_len, char *value) { struct map *map; struct map_entry *entry; - unsigned int i, key_len; + unsigned int i, key_len, n_keys; void **key_trees; map = map_data_find_map(state, domain_name, map_name); + for (n_keys = 0; keys[n_keys] != NULL; n_keys++) { + continue; + } if (value_len == (unsigned int) -1) { value_len = strlen(value); } @@ -893,8 +895,8 @@ map_data_set_entry(struct plugin_state *state, entry->keys = malloc((n_keys + 1) * sizeof(char *)); if (entry->keys != NULL) { for (i = 0; i < n_keys; i++) { - if (key_lens != NULL) { - key_len = key_lens[i]; + if (key_lengths != NULL) { + key_len = key_lengths[i]; } else { key_len = -1; } @@ -934,8 +936,9 @@ map_data_set_entry(struct plugin_state *state, if ((entry->keys != NULL) && (entry->key_len != NULL)) { for (i = 0; i < n_keys; i++) { - if (key_lens != NULL) { - key_len = key_lens[i]; + if (key_lengths != NULL) { + key_len = + key_lengths[i]; } else { key_len = -1; } @@ -79,8 +79,7 @@ void map_data_unset_entry_id(struct plugin_state *state, void map_data_set_entry(struct plugin_state *state, const char *domain_name, const char *map_name, const char *id, - unsigned int n_keys, - unsigned int *key_len, char **keys, + unsigned int *key_lengths, char **keys, unsigned int value_len, char *value); bool_t map_data_check_entry(struct plugin_state *state, const char *domain_name, const char *map_name, |