/* inet_ntoa() returns a pointer to a statically allocated buffer
* I hope non-glibc systems behave the same */
- len = snprintf (pi, size, "%s_%s%u", inet_ntoa (addr),
+ len = ssnprintf (pi, size, "%s_%s%u", inet_ntoa (addr),
(se->protocol == IPPROTO_TCP) ? "TCP" : "UDP",
ntohs (se->port));
/* inet_ntoa() returns a pointer to a statically allocated buffer
* I hope non-glibc systems behave the same */
- len = snprintf (ti, size, "%s_%u", inet_ntoa (addr),
+ len = ssnprintf (ti, size, "%s_%u", inet_ntoa (addr),
ntohs (de->port));
if ((0 > len) || (size <= len)) {
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
vl.interval = interval_g;
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "ipvs");
- strcpy (vl.plugin_instance, pi);
- strcpy (vl.type_instance, (NULL != ti) ? ti : "total");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "ipvs", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, pi, sizeof (vl.plugin_instance));
+ sstrncpy (vl.type, "connections", sizeof (vl.type));
+ sstrncpy (vl.type_instance, (NULL != ti) ? ti : "total",
+ sizeof (vl.type_instance));
- plugin_dispatch_values ("connections", &vl);
+ plugin_dispatch_values (&vl);
return;
} /* cipvs_submit_connections */
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
vl.interval = interval_g;
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "ipvs");
- strcpy (vl.plugin_instance, pi);
- strcpy (vl.type_instance, (NULL != ti) ? ti : "total");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "ipvs", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, pi, sizeof (vl.plugin_instance));
+ sstrncpy (vl.type, t, sizeof (vl.type));
+ sstrncpy (vl.type_instance, (NULL != ti) ? ti : "total",
+ sizeof (vl.type_instance));
- plugin_dispatch_values (t, &vl);
+ plugin_dispatch_values (&vl);
return;
} /* cipvs_submit_if */
char ti[DATA_MAX_NAME_LEN];
- if (0 != get_ti (de, ti, DATA_MAX_NAME_LEN))
+ if (0 != get_ti (de, ti, sizeof (ti)))
return;
cipvs_submit_connections (pi, ti, stats.conns);
int i = 0;
- if (0 != get_pi (se, pi, DATA_MAX_NAME_LEN))
+ if (0 != get_pi (se, pi, sizeof (pi)))
return;
cipvs_submit_connections (pi, NULL, stats.conns);