Commit 07cedb64 07cedb640ed7403527fd136400d8ea32156e183b by Sergey Poznyakoff

(imap_writeline): Fix handling of input

lines longer than 254 chars. Proposed by Daniel Kahn Gillmor.
1 parent 9cac15d6
......@@ -2023,7 +2023,7 @@ imap_writeline (f_imap_t f_imap, const char *format, ...)
va_start(ap, format);
do
{
len = vsnprintf (f_imap->buffer, f_imap->buflen - 1, format, ap);
len = vsnprintf (f_imap->buffer, f_imap->buflen, format, ap);
if (len < 0 || len >= (int)f_imap->buflen
|| !memchr (f_imap->buffer, '\0', len + 1))
{
......