diff options
-rw-r--r-- | sink.c | 15 | ||||
-rw-r--r-- | smtp.c | 6 | ||||
-rw-r--r-- | transact.c | 27 |
3 files changed, 39 insertions, 9 deletions
@@ -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); } @@ -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); @@ -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) |