types.db: Reintroduced the "spam_check" type.
[collectd.git] / src / memory.c
index fe3a16e..a4a9af3 100644 (file)
@@ -109,8 +109,8 @@ static void memory_submit (const char *type_instance, gauge_t value)
        vl.values = values;
        vl.values_len = 1;
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "memory");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "memory", sizeof (vl.plugin));
        strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
        vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
 
@@ -319,7 +319,7 @@ static int memory_read (void)
        if ((ios = sg_get_mem_stats ()) != NULL)
        {
                memory_submit ("used",   ios->used);
-               memory_submit ("cached", ios->cached);
+               memory_submit ("cached", ios->cache);
                memory_submit ("free",   ios->free);
        }
 #endif /* HAVE_LIBSTATGRAB */