bug 13396. It looks like the returned byte count was off on certain size

files.
This commit is contained in:
dougt%netscape.com 1999-09-15 18:24:01 +00:00
Родитель 31856201d4
Коммит 351689f243
1 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -167,7 +167,7 @@ class FileImpl
return NS_ERROR_FAILURE;
PRUint32 bufOffset = 0;
PRUint32 currentWrite = 0;
while (aCount > 0)
{
if (mWriteCursor == nsnull || mWriteCursor == mWriteLimit)
@ -187,17 +187,19 @@ class FileImpl
// move
*aWriteCount = mWriteLimit - mWriteCursor;
currentWrite = mWriteLimit - mWriteCursor;
if (aCount < *aWriteCount)
*aWriteCount = aCount;
if (aCount < currentWrite)
currentWrite = aCount;
memcpy(mWriteCursor, (aBuf + bufOffset), *aWriteCount);
memcpy(mWriteCursor, (aBuf + bufOffset), currentWrite);
aCount -= *aWriteCount;
bufOffset += *aWriteCount;
mWriteCursor += *aWriteCount;
}
mWriteCursor += currentWrite;
aCount -= currentWrite;
bufOffset += currentWrite;
*aWriteCount += currentWrite;
}
return NS_OK;
}
NS_IMETHOD Flush();