cpu plugin: Updated copyright information.
[collectd.git] / src / cpu.c
index 0fadc06..66cd261 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -1,6 +1,7 @@
 /**
  * collectd - src/cpu.c
- * Copyright (C) 2005-2007  Florian octo Forster
+ * Copyright (C) 2005-2009  Florian octo Forster
+ * Copyright (C) 2008       Oleg King
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -17,6 +18,7 @@
  *
  * Authors:
  *   Florian octo Forster <octo at verplant.org>
+ *   Oleg King <king2 at kaluga.ru>
  **/
 
 #include "collectd.h"
@@ -182,12 +184,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)