X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpowerdns.c;h=9d93f93dee4d4c22349195d54ce1b81e61f8e518;hb=5bf80d6ecad0e6684eb38cf2de8e56b4f6b50fe3;hp=51e39ee245e87b2deb4d9e51e706df1147c26a3e;hpb=250dc17bfb3c5488b789347f1f570913701d31ca;p=collectd.git diff --git a/src/powerdns.c b/src/powerdns.c index 51e39ee2..9d93f93d 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -320,11 +320,12 @@ static void submit (const char *plugin_instance, /* {{{ */ vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "powerdns", sizeof (vl.plugin)); + sstrncpy (vl.type, type, sizeof (vl.type)); if (type_instance != NULL) sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); - plugin_dispatch_values (type, &vl); + plugin_dispatch_values (&vl); } /* }}} static void submit */ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */ @@ -349,10 +350,9 @@ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */ memset (&sa_unix, 0, sizeof (sa_unix)); sa_unix.sun_family = AF_UNIX; - strncpy (sa_unix.sun_path, + sstrncpy (sa_unix.sun_path, (local_sockpath != NULL) ? local_sockpath : PDNS_LOCAL_SOCKPATH, sizeof (sa_unix.sun_path)); - sa_unix.sun_path[sizeof (sa_unix.sun_path) - 1] = 0; status = unlink (sa_unix.sun_path); if ((status != 0) && (errno != ENOENT)) @@ -860,7 +860,8 @@ static int powerdns_config_add_server (oconfig_item_t *ci) /* {{{ */ } item->sockaddr.sun_family = AF_UNIX; - sstrncpy (item->sockaddr.sun_path, socket_temp, UNIX_PATH_MAX); + sstrncpy (item->sockaddr.sun_path, socket_temp, + sizeof (item->sockaddr.sun_path)); e = llentry_create (item->instance, item); if (e == NULL)