X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcommon.c;h=7015c875f0fd9c664b99e6c19a54e9ff397f85fa;hb=50c6b81549e3239034f71f00ff7dde4c6a8767e5;hp=142d7979adf1fc2c02e6a54d9a4bdc8483598c4e;hpb=0eff156c7816507fa1865b76e948574dd320fae0;p=collectd.git diff --git a/src/common.c b/src/common.c index 142d7979..7015c875 100644 --- a/src/common.c +++ b/src/common.c @@ -39,11 +39,6 @@ # include #endif -/* for ntohl and htonl */ -#if HAVE_ARPA_INET_H -# include -#endif - /* for getaddrinfo */ #include #include @@ -53,6 +48,11 @@ # include #endif +/* for ntohl and htonl */ +#if HAVE_ARPA_INET_H +# include +#endif + #ifdef HAVE_LIBKSTAT extern kstat_ctl_t *kc; #endif @@ -939,15 +939,15 @@ int parse_identifier_vl (const char *str, value_list_t *vl) /* {{{ */ if (status != 0) return (status); - sstrncpy (vl->host, host, sizeof (host)); - sstrncpy (vl->plugin, plugin, sizeof (plugin)); + sstrncpy (vl->host, host, sizeof (vl->host)); + sstrncpy (vl->plugin, plugin, sizeof (vl->plugin)); sstrncpy (vl->plugin_instance, (plugin_instance != NULL) ? plugin_instance : "", - sizeof (plugin_instance)); - sstrncpy (vl->type, type, sizeof (type)); + sizeof (vl->plugin_instance)); + sstrncpy (vl->type, type, sizeof (vl->type)); sstrncpy (vl->type_instance, (type_instance != NULL) ? type_instance : "", - sizeof (type_instance)); + sizeof (vl->type_instance)); return (0); } /* }}} int parse_identifier_vl */