mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
instead of removing nulls when parsing server responses, replace them with spaces, so we won't throw off the byte counts for imap and pop3, 205789 r/sr=sspitzer
This commit is contained in:
parent
573cbdd5e8
commit
737ce90217
@ -385,19 +385,14 @@ char * nsMsgLineStreamBuffer::ReadNextLine(nsIInputStream * aInputStream, PRUint
|
||||
{
|
||||
aInputStream->Read(startOfLine + m_numBytesInBuffer,
|
||||
numBytesToCopy, &numBytesCopied);
|
||||
PRUint32 i;
|
||||
for (i=m_numBytesInBuffer;i <numBytesCopied;i++) //replace nulls with spaces
|
||||
{
|
||||
if (!startOfLine[i])
|
||||
startOfLine[i] = ' ';
|
||||
}
|
||||
m_numBytesInBuffer += numBytesCopied;
|
||||
m_dataBuffer[m_startPos+m_numBytesInBuffer] = '\0';
|
||||
PRUint32 i,j=0;
|
||||
for (i=0;i <m_numBytesInBuffer;i++) //strip nulls
|
||||
{
|
||||
if (startOfLine[i])
|
||||
startOfLine[j++] = startOfLine[i];
|
||||
}
|
||||
if (i != j)
|
||||
{
|
||||
startOfLine[j] = '\0';
|
||||
m_numBytesInBuffer = j;
|
||||
}
|
||||
}
|
||||
else if (!m_numBytesInBuffer)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user