summaryrefslogtreecommitdiffstats
path: root/aclk/aclk_query.c
diff options
context:
space:
mode:
authorEmmanuel Vasilakis <mrzammler@mm.st>2021-10-22 15:56:46 +0300
committerGitHub <noreply@github.com>2021-10-22 15:56:46 +0300
commit5377adb065af6d0e43973ff5f6b4344353dd1612 (patch)
tree63d19c7704d3019743478efde28208448dab85ce /aclk/aclk_query.c
parenta97f06a6ebdcd4bf197cfb4249ed747a52ac9243 (diff)
Fix warnings from -Wformat-truncation=2 (#11676)
* mark host as UNUSED * use snprintfz instead of snprintf. removes warning: %s directive output between 0 and 4096 bytes may exceed minimum required size of 4095 * increase length to 22 to include full int length. stops warning %d directive output may be truncated writing between 1 and 11 bytes into a region of size 5 * increase buffers to stop warning %0.1f directive output may be truncated writing between 3 and 312 bytes into a region of size 100 * use sprintfz
Diffstat (limited to 'aclk/aclk_query.c')
-rw-r--r--aclk/aclk_query.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/aclk/aclk_query.c b/aclk/aclk_query.c
index b5b525d952..6708e6f471 100644
--- a/aclk/aclk_query.c
+++ b/aclk/aclk_query.c
@@ -353,7 +353,7 @@ void *aclk_query_main_thread(void *ptr)
return NULL;
}
-#define TASK_LEN_MAX 16
+#define TASK_LEN_MAX 22
void aclk_query_threads_start(struct aclk_query_threads *query_threads, mqtt_wss_client client)
{
info("Starting %d query threads.", query_threads->count);
@@ -363,7 +363,7 @@ void aclk_query_threads_start(struct aclk_query_threads *query_threads, mqtt_wss
for (int i = 0; i < query_threads->count; i++) {
query_threads->thread_list[i].idx = i; //thread needs to know its index for statistics
- if(unlikely(snprintf(thread_name, TASK_LEN_MAX, "%s_%d", ACLK_QUERY_THREAD_NAME, i) < 0))
+ if(unlikely(snprintfz(thread_name, TASK_LEN_MAX, "%s_%d", ACLK_QUERY_THREAD_NAME, i) < 0))
error("snprintf encoding error");
netdata_thread_create(
&query_threads->thread_list[i].thread, thread_name, NETDATA_THREAD_OPTION_JOINABLE, aclk_query_main_thread,