X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=transact.c;h=2b8d04f8ec15e8b5256d90f2aa5545954340d722;hb=87bcf29364c4640edb87cc2186b965d1a564d70c;hp=07aab00eb82b6f78a43f1903c756d5b6511b729a;hpb=ecfb21f7457a5137b4664c139ecd69cd36c375f5;p=~andy%2Ffetchmail diff --git a/transact.c b/transact.c index 07aab00e..2b8d04f8 100644 --- a/transact.c +++ b/transact.c @@ -1416,7 +1416,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;