diff --git a/src/nginx.c b/src/nginx.c
index a95362be4f7fd58a29cf3d2db610b0f4f4e71e48..4de59f3752b8827f28bf8885ec2f3c9073dd6c5d 100644 (file)
--- a/src/nginx.c
+++ b/src/nginx.c
if (user != NULL)
{
- if (snprintf (credentials, 1024, "%s:%s", user, pass == NULL ? "" : pass) >= 1024)
+ if (ssnprintf (credentials, sizeof (credentials),
+ "%s:%s", user, pass == NULL ? "" : pass) >= sizeof (credentials))
{
ERROR ("nginx plugin: Credentials would have been truncated.");
return (-1);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "nginx");
strcpy (vl.plugin_instance, "");
- strncpy (vl.type, type, sizeof (vl.type));
+ sstrncpy (vl.type, type, sizeof (vl.type));
if (inst != NULL)
- {
- strncpy (vl.type_instance, inst, sizeof (vl.type_instance));
- vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
- }
+ sstrncpy (vl.type_instance, inst, sizeof (vl.type_instance));
plugin_dispatch_values (&vl);
} /* void submit */