X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Femail.c;h=c78d76146835ab2e55bedac09c8a36f71752e132;hb=d00449bdc71bb7e97e23fc42579a42855afc9492;hp=869b7c36aa620cff5f7ae2f2d806d79868084eea;hpb=38c7319717e785cc4cb158749d2ab02a4a57318c;p=collectd.git diff --git a/src/email.c b/src/email.c index 869b7c36..c78d7614 100644 --- a/src/email.c +++ b/src/email.c @@ -513,7 +513,6 @@ static void *open_connection (void *arg) strncpy (addr.sun_path, sock_file, (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, @@ -733,8 +732,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);