X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Femail.c;h=5e103ed7a82b4330a719230b31620d1df52bc903;hb=074b4980bc75bea6826e6a38dcc6e193a721b2a8;hp=cc68d3fc0f0471a1b10492ca83093f9c3c4e07bc;hpb=f5edd182195cb7a13fa32846ae869a8b8dcc1e3f;p=collectd.git diff --git a/src/email.c b/src/email.c index cc68d3fc..5e103ed7 100644 --- a/src/email.c +++ b/src/email.c @@ -396,9 +396,7 @@ static void *open_connection (void *arg) } addr.sun_family = AF_UNIX; - - strncpy (addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1)); - addr.sun_path[UNIX_PATH_MAX - 1] = '\0'; + sstrncpy (addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1)); errno = 0; if (-1 == bind (connector_socket, (struct sockaddr *)&addr, @@ -661,9 +659,10 @@ static void email_submit (const char *type, const char *type_instance, gauge_t v vl.time = time (NULL); 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)); + sstrncpy (vl.type, type, sizeof (vl.type)); + sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); - plugin_dispatch_values (type, &vl); + plugin_dispatch_values (&vl); } /* void email_submit */ /* Copy list l1 to list l2. l2 may partly exist already, but it is assumed