X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Femail.c;h=200b60c1851dd2ac352a91c43df93678a7f0142f;hb=cacaa2126020832df99fa6423147bd3de6d4faae;hp=87daed113273227cfd3f82601fea5421159e6b67;hpb=d22aee658210cbfa44caa39f302aa9331d4eab82;p=collectd.git diff --git a/src/email.c b/src/email.c index 87daed11..200b60c1 100644 --- a/src/email.c +++ b/src/email.c @@ -394,8 +394,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)); unlink (addr.sun_path); errno = 0; @@ -659,9 +658,10 @@ static void email_submit (const char *type, const char *type_instance, gauge_t v vl.time = time (NULL); strcpy (vl.host, hostname_g); strcpy (vl.plugin, "email"); - 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