aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/influxdb-reader.c5
-rw-r--r--src/plugins/influxdb-writer.c6
-rw-r--r--src/plugins/influxdb.c6
3 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/influxdb-reader.c b/src/plugins/influxdb-reader.c
index b6bef25..a1fa3a0 100644
--- a/src/plugins/influxdb-reader.c
+++ b/src/plugins/influxdb-reader.c
@@ -91,7 +91,6 @@ static void unpack_metric_from_db(void *ml, json_object *metricJ)
wrap_json_array_for_all(columnsJ, fill_key, m_list);
wrap_json_array_for_all(valuesJ, fill_n_send_values, m_list);
-
}
static json_object *unpack_series(json_object *seriesJ)
@@ -176,7 +175,7 @@ static CURL *make_curl_query_get(const char *url)
args[0] = "epoch";
args[1] = "ns";
args[2] = "q";
- strncat(query, "SELECT * FROM /^.*$/", strlen("SELECT * FROM /^.*$/"));
+ strcat(query, "SELECT * FROM /^.*$/");
args[4] = NULL;
length_now = asprintf(&now, "%lu", get_ts());
@@ -192,7 +191,7 @@ static CURL *make_curl_query_get(const char *url)
AFB_ERROR("Error writing last_db_read file: %s\n", strerror( errno ));
}
else {
- strncat(query, " WHERE time >= ", strlen(" WHERE time >= "));
+ strcat(query, " WHERE time >= ");
strncat(query, last_ts, strlen(last_ts));
close(fd_last_read);
fd_last_read = openat(rootdir_fd, "last_db_read", O_TRUNC | O_RDWR);
diff --git a/src/plugins/influxdb-writer.c b/src/plugins/influxdb-writer.c
index fdb1a2a..c21f4fd 100644
--- a/src/plugins/influxdb-writer.c
+++ b/src/plugins/influxdb-writer.c
@@ -132,15 +132,13 @@ CURL *make_curl_write_post(const char *url, json_object *metricsJ)
}
}
- post_data[i] = NULL;
-
/* Check that we just do not broke the for loop before trying preparing CURL
request object */
curl = i == lpd ?
curl_wrap_prepare_post_unescaped(url, NULL, "\n", (const char * const*)post_data) : NULL;
free(serie);
- /*for(i = 0; i < lpd; i++)
- free(post_data[i]);*/
+ for(i = 0; i < lpd; i++)
+ free(post_data[i]);
free(post_data);
return curl;
diff --git a/src/plugins/influxdb.c b/src/plugins/influxdb.c
index 27161ab..a98bd2b 100644
--- a/src/plugins/influxdb.c
+++ b/src/plugins/influxdb.c
@@ -41,11 +41,11 @@ size_t make_url(char *url, size_t l_url, const char *host, const char *port, con
port = port ? port : DEFAULT_DBPORT;
strncat(url, host, strlen(host));
- strncat(url, ":", 1);
+ strcat(url, ":");
strncat(url, port, strlen(port));
- strncat(url, "/", 1);
+ strcat(url, "/");
strncat(url, endpoint, strlen(endpoint));
- strncat(url, "?db="DEFAULT_DB, strlen("?db="DEFAULT_DB));
+ strcat(url, "?db="DEFAULT_DB);
return strlen(url);
}