Unified string handling.
[collectd.git] / src / memory.c
index 5cb574d..c9cb834 100644 (file)
@@ -104,8 +104,7 @@ static void memory_submit (const char *type_instance, gauge_t value)
        strcpy (vl.host, hostname_g);
        strcpy (vl.plugin, "memory");
        strcpy (vl.type, "memory");
-       strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
-       vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
+       sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
 
        plugin_dispatch_values (&vl);
 }