diff options
Diffstat (limited to 'smtp.c')
-rw-r--r-- | smtp.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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); |