diff --git a/src/apcups.c b/src/apcups.c
index 7f8afd461e4cacd6f2eeadca5e2a282039ba79bd..fb481092c18108dbed8d3be09fb41e6655457e26 100644 (file)
--- a/src/apcups.c
+++ b/src/apcups.c
assert ((port > 0x00000000) && (port <= 0x0000FFFF));
/* Convert the port to a string */
- snprintf (port_str, 8, "%i", port);
- port_str[7] = '\0';
+ ssnprintf (port_str, sizeof (port_str), "%i", port);
/* Resolve name */
memset ((void *) &ai_hints, '\0', sizeof (ai_hints));
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "apcups");
strcpy (vl.plugin_instance, "");
- strncpy (vl.type, type, sizeof (vl.type));
- strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
+ sstrncpy (vl.type, type, sizeof (vl.type));
+ sstrncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
plugin_dispatch_values (&vl);
}