From: Matthias Runge Date: Thu, 8 Aug 2019 09:58:55 +0000 (+0200) Subject: Fix compile time issues X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0bbf058d6f9935e6e727cda7db79312281e2f58d;p=collectd.git Fix compile time issues This resolves #3242 and should also resolve #3179. Signed-off-by: Matthias Runge --- diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c index 1f8ab2db..daddf684 100644 --- a/src/daemon/plugin.c +++ b/src/daemon/plugin.c @@ -647,7 +647,8 @@ static void start_read_threads(size_t num) /* {{{ */ } char name[THREAD_NAME_MAX]; - snprintf(name, sizeof(name), "reader#%" PRIu64, (uint64_t)read_threads_num); + ssnprintf(name, sizeof(name), "reader#%" PRIu64, + (uint64_t)read_threads_num); set_thread_name(read_threads[read_threads_num], name); read_threads_num++; @@ -836,8 +837,8 @@ static void start_write_threads(size_t num) /* {{{ */ } char name[THREAD_NAME_MAX]; - snprintf(name, sizeof(name), "writer#%" PRIu64, - (uint64_t)write_threads_num); + ssnprintf(name, sizeof(name), "writer#%" PRIu64, + (uint64_t)write_threads_num); set_thread_name(write_threads[write_threads_num], name); write_threads_num++; diff --git a/src/intel_rdt.c b/src/intel_rdt.c index 515a601e..62848dbf 100644 --- a/src/intel_rdt.c +++ b/src/intel_rdt.c @@ -325,8 +325,12 @@ static int strlisttoarray(char *str_list, char ***names, size_t *names_num) { continue; if ((isdupstr((const char **)*names, *names_num, token))) { - ERROR(RDT_PLUGIN ": Duplicated process name \'%s\' in group \'%s\'", - token, str_list); + if (str_list != NULL) + ERROR(RDT_PLUGIN ": Duplicated process name \'%s\' in group \'%s\'", + token, str_list); + else + ERROR(RDT_PLUGIN ": Duplicated process name \'%s\'", token); + return -EINVAL; } else { if (0 != strarray_add(names, names_num, token)) {