Merge branch 'collectd-5.5' into collectd-5.6
[collectd.git] / src / write_redis.c
index 973b180..c16537c 100644 (file)
@@ -91,7 +91,7 @@ static int wr_write (const data_set_t *ds, /* {{{ */
     node->conn = redisConnectWithTimeout ((char *)node->host, node->port, node->timeout);
     if (node->conn == NULL)
     {
-      ERROR ("write_redis plugin: Connecting to host \"%s\" (port %i) failed: Unkown reason",
+      ERROR ("write_redis plugin: Connecting to host \"%s\" (port %i) failed: Unknown reason",
           (node->host != NULL) ? node->host : "localhost",
           (node->port != 0) ? node->port : 6379);
       pthread_mutex_unlock (&node->lock);
@@ -231,12 +231,13 @@ static int wr_config_node (oconfig_item_t *ci) /* {{{ */
   if (status == 0)
   {
     char cb_name[DATA_MAX_NAME_LEN];
-    user_data_t ud;
 
     ssnprintf (cb_name, sizeof (cb_name), "write_redis/%s", node->name);
 
-    ud.data = node;
-    ud.free_func = wr_config_free;
+    user_data_t ud = {
+      .data = node,
+      .free_func = wr_config_free
+    };
 
     status = plugin_register_write (cb_name, wr_write, &ud);
   }