aboutsummaryrefslogtreecommitdiffstats
path: root/smtp.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-06-23 14:50:12 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-06-23 14:50:12 +0000
commit75b1a90747d6fa2d0d2962856c2875b92ebcfe7b (patch)
tree7431f59f25204ad0d0d672dcd68466d2ef30631c /smtp.c
parentc55e6971c9006e85f25e9ef758b8980d8920e149 (diff)
downloadfetchmail-75b1a90747d6fa2d0d2962856c2875b92ebcfe7b.tar.gz
fetchmail-75b1a90747d6fa2d0d2962856c2875b92ebcfe7b.tar.bz2
fetchmail-75b1a90747d6fa2d0d2962856c2875b92ebcfe7b.zip
strncat/snprintf cleanup.
svn path=/trunk/; revision=3366
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);