]> Pileus Git - ~andy/fetchmail/commitdiff
Don't rely on snprintf.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 4 Jul 2001 02:46:22 +0000 (02:46 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 4 Jul 2001 02:46:22 +0000 (02:46 -0000)
svn path=/trunk/; revision=3393

Makefile.in
fetchmailconf
interface.c
ipv6-connect.c
socket.c

index 046a3c80952575ec1dfdcd06db498d115f0867b6..d6875abcbcdce8b553bf80b9b3fd952cf9e72167 100644 (file)
@@ -4,7 +4,7 @@
 # So just uncomment all the lines marked QNX.
 
 PACKAGE = fetchmail
-VERSION = 5.8.11
+VERSION = 5.9.0
 
 # Ultrix 2.2 make doesn't expand the value of VPATH.
 srcdir = @srcdir@
index a92e542c89a53e734b06204d3f279466f6b632e3..1c75e79851f63f5f0b2d67895b777755c02734d1 100755 (executable)
@@ -1273,6 +1273,13 @@ camel dung identified to me as `popa3d written by Solar Designer'.
 Beware!  The UIDL support in this thing is known to be completely broken,
 and other things probably are too.
 
+"""
+            if string.find(greetline, "MercuryP/NLM v1.48") > 0:
+                warnings = warnings + """
+This is not a POP3 server.  It has delusions of being one, but after
+RETR all messages are automatically marked to be deleted.  The only
+way to prevent this is to issue an RSET before leaving the server.
+
 """
             if string.find(greetline, "POP-Max") > 0:
                 warnings = warnings + """
index 1d61b367ff5147c8d2d88c343d462b336c683a3d..682b788d86f259f03b0f609685333b69dfbb5d9f 100644 (file)
@@ -270,7 +270,12 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
        {
                kvm_read(kvmfd, ifnet_addr, &ifnet, sizeof(ifnet));
                kvm_read(kvmfd, (unsigned long) ifnet.if_name, tname, sizeof tname);
-               snprintf(tname, sizeof tname - 1, "%s%d", tname, ifnet.if_unit);
+#ifdef HAVE_SNPRINTF
+               snprintf(tname, sizeof tname - 1,
+#else
+               sprintf(tname,
+#endif
+                       "%s%d", tname, ifnet.if_unit);
 
                if (!strcmp(tname, iname))
                {
index 2da1edb7256bd32f861a1a3cbf4da0ebc4c1cc36..2e545c5b894585f76a95cfb05492d44be969d1f3 100644 (file)
@@ -78,13 +78,23 @@ int inner_connect(struct addrinfo *ai, void *request, int requestlen, int (*tryi
       continue;
 
     if ((fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) < 0) {
-      snprintf(errorbuf, sizeof(errorbuf), "socket: %s(%d)", strerror(errno), errno);
+#ifdef HAVE_SNPRINTF
+     snprintf(errorbuf, sizeof(errorbuf),
+#else
+     sprintf(errorbuf,
+#endif
+       "socket: %s(%d)", strerror(errno), errno);
       error_callback(myname, errorbuf);
       continue;
     };
 
     if (connect(fd, ai->ai_addr, ai->ai_addrlen) < 0) {
-      snprintf(errorbuf, sizeof(errorbuf), "connect: %s(%d)", strerror(errno), errno);
+#ifdef HAVE_SNPRINTF
+     snprintf(errorbuf, sizeof(errorbuf),
+#else
+     sprintf(errorbuf,
+#endif
+         "connect: %s(%d)", strerror(errno), errno);
       error_callback(myname, errorbuf);
       close(fd);       /* just after a connect; no reads or writes yet */
       continue;
@@ -96,7 +106,12 @@ int inner_connect(struct addrinfo *ai, void *request, int requestlen, int (*tryi
     if (pai)
       *pai = ai;
   } else {
-    snprintf(errorbuf, sizeof(errorbuf), "no connections result");
+#ifdef HAVE_SNPRINTF
+     snprintf(errorbuf, sizeof(errorbuf),
+#else
+     sprintf(errorbuf,
+#endif
+       "no connections result");
     error_callback(myname, errorbuf);
     fd = -1;
   };
index 12dca7ab2ecdefc43a7db19228d5d74b33a59d4d..3ae380164ab937166fc3ed681023a64ac2ede8a4 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -750,7 +750,11 @@ int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict )
                        tp = text;
                        te = text + sizeof(text);
                        for (i = 0; i < dsz; i++) {
+#ifdef HAVE_SNPRINTF
                                esz = snprintf(tp, te - tp, i > 0 ? ":%02X" : "%02X", digest[i]);
+#else
+                               esz = sprintf(tp, i > 0 ? ":%02X" : "%02X", digest[i]);
+#endif
                                if (esz >= te - tp) {
                                        report(stderr, _("Digest text buffer too small!\n"));
                                        return (0);