Fix compile time issues
[collectd.git] / src / intel_rdt.c
index 38f987f..62848db 100644 (file)
  *   Michał Aleksiński <michalx.aleksinski@intel.com>
  **/
 
-#include <pqos.h>
+#include "collectd.h"
 #include "utils/common/common.h"
 #include "utils/config_cores/config_cores.h"
 #include "utils/proc_pids/proc_pids.h"
-#include "collectd.h"
+#include <pqos.h>
 
 #define RDT_PLUGIN "intel_rdt"
 
@@ -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)) {