X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnotify_email.c;h=e620cf6335f1546e229bff9dfc70c7cb967e3b74;hb=8f6aa6970bf787e6a11e095322af3338ec781d78;hp=bb36ff27a2ef934094d3c8c538d13f136f8ec96f;hpb=a9191cc20f0a5af022ae1d9482af2eaf0098a46a;p=collectd.git diff --git a/src/notify_email.c b/src/notify_email.c index bb36ff27..e620cf63 100644 --- a/src/notify_email.c +++ b/src/notify_email.c @@ -24,8 +24,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include #include @@ -104,7 +104,7 @@ static void monitor_cb(const char *buf, int buflen, int writing, static int notify_email_init(void) { char server[MAXSTRING]; - snprintf(server, sizeof(server), "%s:%i", + ssnprintf(server, sizeof(server), "%s:%i", (smtp_host == NULL) ? DEFAULT_SMTP_HOST : smtp_host, smtp_port); pthread_mutex_lock(&session_lock); @@ -214,14 +214,14 @@ static int notify_email_notification(const notification_t *n, char *buf_ptr = buf; int buf_len = sizeof(buf); - snprintf(severity, sizeof(severity), "%s", + ssnprintf(severity, sizeof(severity), "%s", (n->severity == NOTIF_FAILURE) ? "FAILURE" : ((n->severity == NOTIF_WARNING) ? "WARNING" : ((n->severity == NOTIF_OKAY) ? "OKAY" : "UNKNOWN"))); - snprintf(subject, sizeof(subject), + ssnprintf(subject, sizeof(subject), (email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject, severity, n->host); @@ -231,7 +231,7 @@ static int notify_email_notification(const notification_t *n, timestamp_str[sizeof(timestamp_str) - 1] = '\0'; /* Let's make RFC822 message text with \r\n EOLs */ - int status = snprintf(buf, buf_len, + int status = ssnprintf(buf, buf_len, "MIME-Version: 1.0\r\n" "Content-Type: text/plain; charset=\"US-ASCII\"\r\n" "Content-Transfer-Encoding: 8bit\r\n" @@ -248,7 +248,7 @@ static int notify_email_notification(const notification_t *n, #define APPEND(format, value) \ if ((buf_len > 0) && (strlen(value) > 0)) { \ - status = snprintf(buf_ptr, buf_len, format "\r\n", value); \ + status = ssnprintf(buf_ptr, buf_len, format "\r\n", value); \ if (status > 0) { \ buf_ptr += status; \ buf_len -= status; \