aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sink.c15
-rw-r--r--smtp.c6
-rw-r--r--transact.c27
3 files changed, 39 insertions, 9 deletions
diff --git a/sink.c b/sink.c
index 20c23919..b8712ccf 100644
--- a/sink.c
+++ b/sink.c
@@ -693,9 +693,14 @@ int open_sink(struct query *ctl, struct msgblk *msg,
return(PS_REFUSED);
#endif /* __UNUSED__ */
+#ifdef HAVE_SNPRINTF
+ snprintf(errbuf, sizeof(errbuf), "%s: %s",
+ idp->id, smtp_response);
+#else
strncpy(errbuf, idp->id, sizeof(errbuf));
- strncat(errbuf, ": ", sizeof(errbuf));
- strncat(errbuf, smtp_response, sizeof(errbuf));
+ strcat(errbuf, ": ");
+ strcat(errbuf, smtp_response);
+#endif /* HAVE_SNPRINTF */
xalloca(from_responses[*bad_addresses],
char *,
@@ -1181,7 +1186,11 @@ va_dcl
#endif
va_end(ap);
- strncat(buf, "\r\n", sizeof(buf));
+#ifdef HAVE_SNPRINTF
+ snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\r\n");
+#else
+ strcat(buf, "\r\n");
+#endif /* HAVE_SNPRINTF */
stuffline(ctl, buf);
}
diff --git a/smtp.c b/smtp.c
index 530d17e4..23ada08f 100644
--- a/smtp.c
+++ b/smtp.c
@@ -111,7 +111,11 @@ int SMTP_from(int sock, const char *from, const char *opts)
#endif /* HAVE_SNPRINTF */
"MAIL FROM:<%s>", from);
if (opts)
- strncat(buf, opts, sizeof(buf));
+#ifdef HAVE_SNPRINTF
+ snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%s", opts);
+#else
+ strcat(buf, opts);
+#endif /* HAVE_SNPRINTF */
SockPrintf(sock,"%s\r\n", buf);
if (outlevel >= O_MONITOR)
report(stdout, "%cMTP> %s\n", smtp_mode, buf);
diff --git a/transact.c b/transact.c
index eb195503..c31946ae 100644
--- a/transact.c
+++ b/transact.c
@@ -1056,7 +1056,11 @@ int readheaders(int sock,
ctl->server.pollname,
ctl->remotename);
}
- strncat(buf, ")\r\n", sizeof(buf));
+#ifdef HAVE_SNPRINTF
+ snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), ")\r\n");
+#else
+ strcat(buf, ")\r\n");
+#endif /* HAVE_SNPRINTF */
n = stuffline(ctl, buf);
if (n != -1)
{
@@ -1101,8 +1105,13 @@ int readheaders(int sock,
else
buf[1] = '\0';
- strncat(buf, rfc822timestamp(), sizeof(buf));
- strncat(buf, "\r\n", sizeof(buf));
+#ifdef HAVE_SNPRINTF
+ snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%s\r\n",
+ rfc822timestamp());
+#else
+ strcat(buf, rfc822timestamp());
+ strcat(buf, "\r\n");
+#endif /* HAVE_SNPRINTF */
n = stuffline(ctl, buf);
}
}
@@ -1337,7 +1346,11 @@ va_dcl
#endif
va_end(ap);
- strncat(buf, "\r\n", sizeof(buf));
+#ifdef HAVE_SNPRINTF
+ snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\r\n");
+#else
+ strcat(buf, "\r\n");
+#endif /* HAVE_SNPRINTF */
SockWrite(sock, buf, strlen(buf));
if (outlevel >= O_MONITOR)
@@ -1423,7 +1436,11 @@ va_dcl
#endif
va_end(ap);
- strncat(buf, "\r\n", sizeof(buf));
+#ifdef HAVE_SNPRINTF
+ snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\r\n");
+#else
+ strcat(buf, "\r\n");
+#endif /* HAVE_SNPRINTF */
SockWrite(sock, buf, strlen(buf));
if (outlevel >= O_MONITOR)