Merge branch 'collectd-4.3' into collectd-4.4
[collectd.git] / src / email.c
index ed10e34..9a93405 100644 (file)
@@ -396,7 +396,6 @@ static void *open_connection (void *arg)
 
        strncpy (addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1));
        addr.sun_path[UNIX_PATH_MAX - 1] = '\0';
-       unlink (addr.sun_path);
 
        errno = 0;
        if (-1 == bind (connector_socket, (struct sockaddr *)&addr,
@@ -657,8 +656,8 @@ static void email_submit (const char *type, const char *type_instance, gauge_t v
        vl.values = values;
        vl.values_len = 1;
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "email");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "email", sizeof (vl.plugin));
        strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
 
        plugin_dispatch_values (type, &vl);