X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcommon.c;h=142d7979adf1fc2c02e6a54d9a4bdc8483598c4e;hb=c9827c15fc557d7c9201f925f406023d660478eb;hp=1c80e8f1b8cd6d2f85dfebd482e30caf88cdf6d0;hpb=853b3da5d4c6614d7db4093f57b1ca4f57b6c485;p=collectd.git diff --git a/src/common.c b/src/common.c index 1c80e8f1..142d7979 100644 --- a/src/common.c +++ b/src/common.c @@ -941,9 +941,13 @@ int parse_identifier_vl (const char *str, value_list_t *vl) /* {{{ */ sstrncpy (vl->host, host, sizeof (host)); sstrncpy (vl->plugin, plugin, sizeof (plugin)); - sstrncpy (vl->plugin_instance, plugin_instance, sizeof (plugin_instance)); + sstrncpy (vl->plugin_instance, + (plugin_instance != NULL) ? plugin_instance : "", + sizeof (plugin_instance)); sstrncpy (vl->type, type, sizeof (type)); - sstrncpy (vl->type_instance, type_instance, sizeof (type_instance)); + sstrncpy (vl->type_instance, + (type_instance != NULL) ? type_instance : "", + sizeof (type_instance)); return (0); } /* }}} int parse_identifier_vl */ @@ -963,11 +967,11 @@ int parse_value (const char *value, value_t *ret_value, int ds_type) break; case DS_TYPE_DERIVE: - ret_value->counter = (derive_t) strtoll (value, &endptr, 0); + ret_value->derive = (derive_t) strtoll (value, &endptr, 0); break; case DS_TYPE_ABSOLUTE: - ret_value->counter = (absolute_t) strtoull (value, &endptr, 0); + ret_value->absolute = (absolute_t) strtoull (value, &endptr, 0); break; default: