Merge branch 'collectd-5.7' into collectd-5.8
[collectd.git] / src / write_kafka.c
index 17a83e0..2baaf0e 100644 (file)
@@ -97,7 +97,7 @@ static uint32_t kafka_hash(const char *keydata, size_t keylen) {
 #define KAFKA_RANDOM_KEY_BUFFER                                                \
   (char[KAFKA_RANDOM_KEY_SIZE]) { "" }
 static char *kafka_random_key(char buffer[static KAFKA_RANDOM_KEY_SIZE]) {
 #define KAFKA_RANDOM_KEY_BUFFER                                                \
   (char[KAFKA_RANDOM_KEY_SIZE]) { "" }
 static char *kafka_random_key(char buffer[static KAFKA_RANDOM_KEY_SIZE]) {
-  ssnprintf(buffer, KAFKA_RANDOM_KEY_SIZE, "%08" PRIX32, cdrand_u());
+  snprintf(buffer, KAFKA_RANDOM_KEY_SIZE, "%08" PRIX32, cdrand_u());
   return buffer;
 }
 
   return buffer;
 }
 
@@ -121,12 +121,12 @@ static int kafka_handle(struct kafka_topic_context *ctx) /* {{{ */
   rd_kafka_topic_conf_t *topic_conf;
 
   if (ctx->kafka != NULL && ctx->topic != NULL)
   rd_kafka_topic_conf_t *topic_conf;
 
   if (ctx->kafka != NULL && ctx->topic != NULL)
-    return (0);
+    return 0;
 
   if (ctx->kafka == NULL) {
     if ((conf = rd_kafka_conf_dup(ctx->kafka_conf)) == NULL) {
       ERROR("write_kafka plugin: cannot duplicate kafka config");
 
   if (ctx->kafka == NULL) {
     if ((conf = rd_kafka_conf_dup(ctx->kafka_conf)) == NULL) {
       ERROR("write_kafka plugin: cannot duplicate kafka config");
-      return (1);
+      return 1;
     }
 
     if ((ctx->kafka = rd_kafka_new(RD_KAFKA_PRODUCER, conf, errbuf,
     }
 
     if ((ctx->kafka = rd_kafka_new(RD_KAFKA_PRODUCER, conf, errbuf,
@@ -166,7 +166,7 @@ static int kafka_handle(struct kafka_topic_context *ctx) /* {{{ */
          rd_kafka_topic_name(ctx->topic));
   }
 
          rd_kafka_topic_name(ctx->topic));
   }
 
-  return (0);
+  return 0;
 
 } /* }}} int kafka_handle */
 
 
 } /* }}} int kafka_handle */
 
@@ -406,8 +406,8 @@ static void kafka_config_topic(rd_kafka_conf_t *conf,
   rd_kafka_topic_conf_set_partitioner_cb(tctx->conf, kafka_partition);
   rd_kafka_topic_conf_set_opaque(tctx->conf, tctx);
 
   rd_kafka_topic_conf_set_partitioner_cb(tctx->conf, kafka_partition);
   rd_kafka_topic_conf_set_opaque(tctx->conf, tctx);
 
-  ssnprintf(callback_name, sizeof(callback_name), "write_kafka/%s",
-            tctx->topic_name);
+  snprintf(callback_name, sizeof(callback_name), "write_kafka/%s",
+           tctx->topic_name);
 
   status = plugin_register_write(
       callback_name, kafka_write,
 
   status = plugin_register_write(
       callback_name, kafka_write,
@@ -489,7 +489,7 @@ static int kafka_config(oconfig_item_t *ci) /* {{{ */
   }
   if (conf != NULL)
     rd_kafka_conf_destroy(conf);
   }
   if (conf != NULL)
     rd_kafka_conf_destroy(conf);
-  return (0);
+  return 0;
 errout:
   if (conf != NULL)
     rd_kafka_conf_destroy(conf);
 errout:
   if (conf != NULL)
     rd_kafka_conf_destroy(conf);