Merge branch 'collectd-4.3' into collectd-4.4
[collectd.git] / src / email.c
index 87daed1..510a664 100644 (file)
@@ -292,7 +292,7 @@ static void *collect (void *arg)
 
                        len = strlen (line);
                        if (('\n' != line[len - 1]) && ('\r' != line[len - 1])) {
-                               log_warn ("[thread #%5lu] line too long (> %i characters): "
+                               log_warn ("[thread #%5lu] line too long (> %lu characters): "
                                                "'%s' (truncated)", self, sizeof (line) - 1, line);
 
                                while (NULL != fgets (line, sizeof (line), this->socket))
@@ -657,8 +657,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);