if (Buf == NULL) return -1;
xferbuf = (char*) malloc(Buf->BufSize);
+ *xferbuf = '\0';
siz = CtdlDecodeBase64(xferbuf,
Buf->buf,
Buf->BufUsed);
pch = NULL;
if (EmailEnd != NULL) {
gt = 1;
- EmailEnd --;
}
else {
EmailEnd = pche;
else {
pch = EmailEnd + 1;
- while ((EmailEnd > UserStart) &&
+ while ((EmailEnd > UserStart) && !gt &&
((*EmailEnd == ',') ||
(*EmailEnd == '>') ||
(isspace(*EmailEnd))))
{
if (*EmailEnd == '>')
gt = 1;
- EmailEnd--;
+ else
+ EmailEnd--;
}
if (EmailEnd == UserStart)
break;
EmailStart = strchr(UserStart, '<');
if ((EmailStart == NULL) || (EmailStart > EmailEnd))
break;
- UserEnd = EmailStart - 1;
+ UserEnd = EmailStart;
+
+ while ((UserEnd > UserStart) &&
+ isspace (*(UserEnd - 1)))
+ UserEnd --;
EmailStart ++;
if (UserStart >= UserEnd)
UserStart = UserEnd = NULL;
*encoding = toupper(*encoding);
if (*encoding == 'B') { /**< base64 */
+ if (ConvertBuf2->BufSize < ConvertBuf->BufUsed)
+ IncreaseBuf(ConvertBuf2, 0, ConvertBuf->BufUsed);
ConvertBuf2->BufUsed = CtdlDecodeBase64(ConvertBuf2->buf,
ConvertBuf->buf,
ConvertBuf->BufUsed);
pos++;
}
+ if (ConvertBuf2->BufSize < ConvertBuf->BufUsed)
+ IncreaseBuf(ConvertBuf2, 0, ConvertBuf->BufUsed);
+
ConvertBuf2->BufUsed = CtdlDecodeQuotedPrintable(
ConvertBuf2->buf,
ConvertBuf->buf,