X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcpu.c;h=e9ab78320d4523848274f726eb42e2bb87eb030f;hb=92445ff3363441d0f515de4a3ab92a504cfc0366;hp=0fadc06458d2fbb5ace382a731bb6bcf19283bb3;hpb=d767db104769bed7fefea61538bdacb364434e9a;p=collectd.git diff --git a/src/cpu.c b/src/cpu.c index 0fadc064..e9ab7832 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -182,12 +182,12 @@ static void submit (int cpu_num, const char *type_instance, counter_t value) vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "cpu", sizeof (vl.plugin)); - snprintf (vl.plugin_instance, sizeof (vl.type_instance), + ssnprintf (vl.plugin_instance, sizeof (vl.type_instance), "%i", cpu_num); - vl.plugin_instance[DATA_MAX_NAME_LEN - 1] = '\0'; + sstrncpy (vl.type, "cpu", sizeof (vl.type)); sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); - plugin_dispatch_values ("cpu", &vl); + plugin_dispatch_values (&vl); } static int cpu_read (void)