X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnotify_email.c;h=2059db4cb60a7b572aee03139b56cc4e360b1d00;hb=1795f8bca674517bb2807b60d954803966caf74d;hp=13d27c2bb97a1a4e7157a718778fe764bea03d40;hpb=af8a7aed88f5173ca53453841557969497b85357;p=collectd.git diff --git a/src/notify_email.c b/src/notify_email.c index 13d27c2b..2059db4c 100644 --- a/src/notify_email.c +++ b/src/notify_email.c @@ -41,8 +41,8 @@ static const char *config_keys[] = }; static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); -static char **emails; -static int emails_len = 0; +static char **recipients; +static int recipients_len = 0; static smtp_session_t session; static smtp_message_t message; @@ -153,19 +153,19 @@ static int notify_email_config (const char *key, const char *value) { char **tmp; - tmp = (char **) realloc ((void *) emails, (emails_len + 1) * sizeof (char *)); + tmp = (char **) realloc ((void *) recipients, (recipients_len + 1) * sizeof (char *)); if (tmp == NULL) { ERROR ("notify_email: realloc failed."); return (-1); } - emails = tmp; - emails[emails_len] = strdup (value); - if (emails[emails_len] == NULL) { + recipients = tmp; + recipients[recipients_len] = strdup (value); + if (recipients[recipients_len] == NULL) { ERROR ("notify_email: strdup failed."); return (-1); } - emails_len++; + recipients_len++; } else if (0 == strcasecmp (key, "SMTPHost")) { sfree (smtp_host); @@ -254,8 +254,8 @@ static int notify_email_notification (const notification_t *n) smtp_set_header (message, "To", NULL, NULL); smtp_set_message_str (message, buf); - for (i = 0; i < emails_len; i++) - recipient = smtp_add_recipient (message, emails[i]); + for (i = 0; i < recipients_len; i++) + recipient = smtp_add_recipient (message, recipients[i]); /* Initiate a connection to the SMTP server and transfer the message. */ if (!smtp_start_session (session)) {