openbsd-ports/mail/popclient/patches/patch-pop3_c
sthen aeac6741d9 cleanup; mostly from Brad.
- Cleans up the Makefile a bit of stuff that isn't necessary.
- Add missing headers to get rid of implicit function warnings.
- Renames conflicting MSGBUFSIZE define to POPMSGBUFSIZE.
- Sync PLIST.
- Remove stray space in DESCR.
- Bump PKGNAME.
2010-07-09 07:17:37 +00:00

58 lines
1.4 KiB
Plaintext

$OpenBSD: patch-pop3_c,v 1.3 2010/07/09 07:17:37 sthen Exp $
--- pop3.c.orig Mon Sep 11 19:48:48 1995
+++ pop3.c Thu Jul 8 21:33:54 2010
@@ -67,6 +67,7 @@
#include <sys/time.h>
#include <ctype.h>
+#include <netdb.h>
#include <errno.h>
#include "socket.h"
@@ -122,7 +123,10 @@ struct optrec *options;
/* open the socket and get the greeting */
if ((socket = Socket(servername,POP3_PORT)) < 0) {
- perror("doPOP3: socket");
+ if (socket == -2)
+ herror("doPOP3: socket");
+ else
+ perror("doPOP3: socket");
return(PS_SOCKET);
}
@@ -583,10 +587,10 @@ int socket;
int mboxfd;
int topipe;
{
- char buf [MSGBUFSIZE];
+ char buf [POPMSGBUFSIZE];
char *bufp;
char savec;
- char fromBuf[MSGBUFSIZE];
+ char fromBuf[POPMSGBUFSIZE];
int needFrom;
int lines,sizeticker;
time_t now;
@@ -607,9 +611,9 @@ int topipe;
/* read the message content from the server */
lines = 0;
- sizeticker = MSGBUFSIZE;
+ sizeticker = POPMSGBUFSIZE;
while (1) {
- if (SockGets(socket,buf,sizeof(buf)) < 0)
+ if (SockGets(socket,buf,sizeof(buf)-1) < 0)
return(PS_SOCKET);
bufp = buf;
if (*bufp == '.') {
@@ -653,7 +657,7 @@ int topipe;
if (sizeticker <= 0) {
if (outlevel > O_SILENT && outlevel < O_VERBOSE && mboxfd != 1)
fputc('.',stderr);
- sizeticker = MSGBUFSIZE;
+ sizeticker = POPMSGBUFSIZE;
}
lines++;
}