X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=transact.c;h=ec8013a516f03d1f66f83bf4af37a65e25ce0708;hb=ecade79a63e9abad933e3705a02533620ddc92b5;hp=d1e4f6a9588ea791d7dc65343d529f8e46c235e2;hpb=002be7a0f5bddce96e52f6f66a7e2449987ef48c;p=~andy%2Ffetchmail diff --git a/transact.c b/transact.c index d1e4f6a9..ec8013a5 100644 --- a/transact.c +++ b/transact.c @@ -1435,7 +1435,15 @@ int readbody(int sock, struct query *ctl, flag forward, int len) * so we might end truncating messages prematurely. */ if (!protocol->delimited && linelen > len) { + /* FIXME: HACK ALERT! This \r\n is only here to make sure the + * \n\0 hunt works later on. The \n generated here was not + * part of the original message! + * The real fix will be to use buffer + length strings, + * rather than 0-terminated C strings. */ + inbufp[len++] = '\r'; + inbufp[len++] = '\n'; inbufp[len] = '\0'; + linelen = len; } len -= linelen;