X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fnotify_email.c;h=52cc83843f8f7ec163badaf08925a7d46ed55414;hp=c1ce2f8bbd9cd6fa3568cd3c5274e07215de0029;hb=1159cb5d383c55a80a0db100b8f7aadcf44740a5;hpb=217ec252adf547f2dd048489e2498bc31e8f70db diff --git a/src/notify_email.c b/src/notify_email.c index c1ce2f8b..52cc8384 100644 --- a/src/notify_email.c +++ b/src/notify_email.c @@ -104,8 +104,8 @@ static void monitor_cb(const char *buf, int buflen, int writing, static int notify_email_init(void) { char server[MAXSTRING]; - ssnprintf(server, sizeof(server), "%s:%i", - (smtp_host == NULL) ? DEFAULT_SMTP_HOST : smtp_host, smtp_port); + snprintf(server, sizeof(server), "%s:%i", + (smtp_host == NULL) ? DEFAULT_SMTP_HOST : smtp_host, smtp_port); pthread_mutex_lock(&session_lock); @@ -214,16 +214,16 @@ static int notify_email_notification(const notification_t *n, int buf_len = sizeof(buf); int i; - ssnprintf(severity, sizeof(severity), "%s", - (n->severity == NOTIF_FAILURE) - ? "FAILURE" - : ((n->severity == NOTIF_WARNING) - ? "WARNING" - : ((n->severity == NOTIF_OKAY) ? "OKAY" : "UNKNOWN"))); + snprintf(severity, sizeof(severity), "%s", + (n->severity == NOTIF_FAILURE) + ? "FAILURE" + : ((n->severity == NOTIF_WARNING) + ? "WARNING" + : ((n->severity == NOTIF_OKAY) ? "OKAY" : "UNKNOWN"))); - ssnprintf(subject, sizeof(subject), - (email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject, - severity, n->host); + snprintf(subject, sizeof(subject), + (email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject, + severity, n->host); localtime_r(&CDTIME_T_TO_TIME_T(n->time), ×tamp_tm); strftime(timestamp_str, sizeof(timestamp_str), "%Y-%m-%d %H:%M:%S", @@ -231,15 +231,15 @@ 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 */ - 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" - "Subject: %s\r\n" - "\r\n" - "%s - %s@%s\r\n" - "\r\n" - "Message: %s", - subject, timestamp_str, severity, n->host, n->message); + snprintf(buf, buf_len, "MIME-Version: 1.0\r\n" + "Content-Type: text/plain; charset=\"US-ASCII\"\r\n" + "Content-Transfer-Encoding: 8bit\r\n" + "Subject: %s\r\n" + "\r\n" + "%s - %s@%s\r\n" + "\r\n" + "Message: %s", + subject, timestamp_str, severity, n->host, n->message); pthread_mutex_lock(&session_lock);