aboutsummaryrefslogtreecommitdiffstats
path: root/smtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'smtp.c')
-rw-r--r--smtp.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/smtp.c b/smtp.c
index 703b10fd..530d17e4 100644
--- a/smtp.c
+++ b/smtp.c
@@ -97,11 +97,21 @@ int SMTP_from(int sock, const char *from, const char *opts)
char buf[MSGBUFSIZE];
if (strchr(from, '<'))
- sprintf(buf, "MAIL FROM: %s", from);
+#ifdef HAVE_SNPRINTF
+ snprintf(buf, sizeof(buf),
+#else
+ sprintf(buf,
+#endif /* HAVE_SNPRINTF */
+ "MAIL FROM: %s", from);
else
- sprintf(buf, "MAIL FROM:<%s>", from);
+#ifdef HAVE_SNPRINTF
+ snprintf(buf, sizeof(buf),
+#else
+ sprintf(buf,
+#endif /* HAVE_SNPRINTF */
+ "MAIL FROM:<%s>", from);
if (opts)
- strcat(buf, opts);
+ strncat(buf, opts, sizeof(buf));
SockPrintf(sock,"%s\r\n", buf);
if (outlevel >= O_MONITOR)
report(stdout, "%cMTP> %s\n", smtp_mode, buf);