*out++ = CR; *out++ = LF;
*out++ = nsCRT::CR; *out++ = nsCRT::LF;
msg_format_Header_addresses (const char *names, const char *addrs,							 int count, PRBool wrap_lines_p){	char *result, *out;	const char *s1, *s2;	PRUint32 i, size = 0;	PRUint32 column = 10;	PRUint32 len1, len2;	PRUint32 name_maxlen = 0;	PRUint32 addr_maxlen = 0;	if (count <= 0)		return 0;	s1 = names;	s2 = addrs;	for (i = 0; (int)i < count; i++)	{		len1 = nsCRT::strlen(s1);		len2 = nsCRT::strlen(s2);		s1 += len1 + 1;		s2 += len2 + 1;				len1 = (len1 * 2) + 2;  //(N*2) + 2 in case we need to quote it		len2 = (len2 * 2) + 2;		name_maxlen = PR_MAX(name_maxlen, len1);		addr_maxlen = PR_MAX(addr_maxlen, len2);		size += len1 + len2 + 10;	}	result = (char *)PR_Malloc(size + 1);	char *aName = (char *)PR_Malloc(name_maxlen + 1);	char *anAddr = (char *)PR_Malloc(addr_maxlen + 1);	if (!result || !aName || !anAddr)	{		PR_FREEIF(result);		PR_FREEIF(aName);		PR_FREEIF(anAddr);		return 0;	}	out = result;	s1 = names;	s2 = addrs;	for (i = 0; (int)i < count; i++)	{		char *o;				PL_strncpy(aName, s1, name_maxlen);		PL_strncpy(anAddr, s2, addr_maxlen);		len1 = msg_quote_phrase_or_addr(aName, nsCRT::strlen(s1), PR_FALSE);		len2 = msg_quote_phrase_or_addr(anAddr, nsCRT::strlen(s2), PR_TRUE);		if (   wrap_lines_p && i > 0		    && (column + len1 + len2 + 3 + (((int)(i+1) < count) ? 2 : 0) > 76))		{			if (out > result && out[-1] == ' ')				out--;			*out++ = CR;			*out++ = LF;			*out++ = '\t';			column = 8;		}		o = out;		if (len1)		{			nsCRT::memcpy(out, aName, len1);			out += len1;			*out++ = ' ';			*out++ = '<';		}		nsCRT::memcpy(out, anAddr, len2);		out += len2;		if (len1)			*out++ = '>';		if ((int)(i+1) < count)		{			*out++ = ',';			*out++ = ' ';		}		s1 += nsCRT::strlen(s1) + 1;		s2 += nsCRT::strlen(s2) + 1;		column += (out - o);	}	*out = 0;		PR_FREEIF(aName);	PR_FREEIF(anAddr);		return result;}