diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-06-23 14:50:12 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-06-23 14:50:12 +0000 |
commit | 75b1a90747d6fa2d0d2962856c2875b92ebcfe7b (patch) | |
tree | 7431f59f25204ad0d0d672dcd68466d2ef30631c /smtp.c | |
parent | c55e6971c9006e85f25e9ef758b8980d8920e149 (diff) | |
download | fetchmail-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.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); |