Code

Unified string handling.
[collectd.git] / src / memory.c
index 5cb574dc9f18ef3c8dace1d9e90a6e0041c526ac..c9cb83402fbf4c42d4164b379944778afebbc33a 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);
 }