int status;
int i;
- data = (tn_data_t *) malloc (sizeof (*data));
+ data = calloc (1, sizeof (*data));
if (data == NULL)
{
- ERROR ("tn_create: malloc failed.");
+ ERROR ("tn_create: calloc failed.");
return (-ENOMEM);
}
- memset (data, 0, sizeof (*data));
data->message = NULL;
data->severity = 0;
notification_meta_t __attribute__((unused)) **meta, void **user_data)
{
tn_data_t *data;
- notification_t n;
+ notification_t n = { 0 };
char temp[NOTIF_MAX_MSG_LEN];
gauge_t *rates;
int rates_failed;
- int i;
+ size_t i;
if ((ds == NULL) || (vl == NULL) || (user_data == NULL))
return (-EINVAL);
}
/* Initialize the structure. */
- memset (&n, 0, sizeof (n));
n.severity = data->severity;
n.time = cdtime ();
sstrncpy (n.message, data->message, sizeof (n.message));
void module_register (void)
{
- target_proc_t tproc;
+ target_proc_t tproc = { 0 };
- memset (&tproc, 0, sizeof (tproc));
tproc.create = tn_create;
tproc.destroy = tn_destroy;
tproc.invoke = tn_invoke;