summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: af8a7ae)
raw | patch | inline | side by side (parent: af8a7ae)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 4 Jun 2008 13:45:10 +0000 (15:45 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 4 Jun 2008 13:45:10 +0000 (15:45 +0200) |
This is much easier to understand.
src/notify_email.c | patch | blob | history |
diff --git a/src/notify_email.c b/src/notify_email.c
index 13d27c2bb97a1a4e7157a718778fe764bea03d40..2059db4cb60a7b572aee03139b56cc4e360b1d00 100644 (file)
--- a/src/notify_email.c
+++ b/src/notify_email.c
};
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;
{
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);
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)) {