зеркало из https://github.com/mozilla/gecko-dev.git
bug 13396. It looks like the returned byte count was off on certain size
files.
This commit is contained in:
Родитель
31856201d4
Коммит
351689f243
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче