aboutsummaryrefslogtreecommitdiffstats
path: root/smtp.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2004-11-10 19:57:47 +0000
committerMatthias Andree <matthias.andree@gmx.de>2004-11-10 19:57:47 +0000
commit2ed8dc12cd5ffbbff9cd25e928a720be3596f2af (patch)
tree994d80cb32bb77ad0f380f9254a7e3171d2ec051 /smtp.c
parent13c27199231cbc2cc83969ada741b95be1cca4d3 (diff)
downloadfetchmail-2ed8dc12cd5ffbbff9cd25e928a720be3596f2af.tar.gz
fetchmail-2ed8dc12cd5ffbbff9cd25e928a720be3596f2af.tar.bz2
fetchmail-2ed8dc12cd5ffbbff9cd25e928a720be3596f2af.zip
Clean up the horrible HAVE_[V]SNPRINTF mess, use Trio on systems that lack
real snprintf or vsnprintf. svn path=/trunk/; revision=3996
Diffstat (limited to 'smtp.c')
-rw-r--r--smtp.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/smtp.c b/smtp.c
index 2595a57e..8642feb0 100644
--- a/smtp.c
+++ b/smtp.c
@@ -8,14 +8,15 @@
* For license terms, see the file COPYING in this directory.
*/
+#include "config.h"
+#include "fetchmail.h"
+
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
-#include "fetchmail.h"
#include "socket.h"
#include "smtp.h"
-#include "config.h"
#include "i18n.h"
struct opt
@@ -105,11 +106,7 @@ static void SMTP_auth(int sock, char *username, char *password, char *buf)
report(stdout, GT_("Challenge decoded: %s\n"), b64buf);
hmac_md5(password, strlen(password),
b64buf, strlen(b64buf), digest, sizeof(digest));
-#ifdef HAVE_SNPRINTF
snprintf(tmp, sizeof(tmp),
-#else
- sprintf(tmp,
-#endif /* HAVE_SNPRINTF */
"%s %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
username, digest[0], digest[1], digest[2], digest[3],
digest[4], digest[5], digest[6], digest[7], digest[8],
@@ -124,12 +121,7 @@ static void SMTP_auth(int sock, char *username, char *password, char *buf)
int len;
if (outlevel >= O_MONITOR)
report(stdout, GT_("ESMTP PLAIN Authentication...\n"));
-#ifdef HAVE_SNPRINTF
- snprintf(tmp, sizeof(tmp),
-#else
- sprintf(tmp,
-#endif /* HAVE_SNPRINTF */
- "^%s^%s", username, password);
+ snprintf(tmp, sizeof(tmp), "^%s^%s", username, password);
len = strlen(tmp);
for (c = len - 1; c >= 0; c--)
@@ -233,25 +225,11 @@ int SMTP_from(int sock, const char *from, const char *opts)
char buf[MSGBUFSIZE];
if (from[0]=='<')
-#ifdef HAVE_SNPRINTF
- snprintf(buf, sizeof(buf),
-#else
- sprintf(buf,
-#endif /* HAVE_SNPRINTF */
- "MAIL FROM:%s", from);
+ snprintf(buf, sizeof(buf), "MAIL FROM:%s", from);
else
-#ifdef HAVE_SNPRINTF
- snprintf(buf, sizeof(buf),
-#else
- sprintf(buf,
-#endif /* HAVE_SNPRINTF */
- "MAIL FROM:<%s>", from);
+ snprintf(buf, sizeof(buf), "MAIL FROM:<%s>", from);
if (opts)
-#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);