Fix assert.
Always open() files with O_BINARY, so Windows doesn't mess with data. We can handle newlines on our own.
This commit is contained in:
@@ -139,7 +139,7 @@ bool MsdFile::ReadFile( CString sNewPath )
|
|||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
/* Open a file. */
|
/* Open a file. */
|
||||||
if( (fd = open(sNewPath, O_RDONLY, 0)) == -1 )
|
if( (fd = open(sNewPath, O_RDONLY|O_BINARY, 0)) == -1 )
|
||||||
{
|
{
|
||||||
error = strerror(errno);
|
error = strerror(errno);
|
||||||
return false;
|
return false;
|
||||||
@@ -153,7 +153,7 @@ bool MsdFile::ReadFile( CString sNewPath )
|
|||||||
int iBytesRead = read( fd, szFileString, iBufferSize );
|
int iBytesRead = read( fd, szFileString, iBufferSize );
|
||||||
close( fd );
|
close( fd );
|
||||||
|
|
||||||
ASSERT( iBufferSize > iBytesRead );
|
ASSERT( iBufferSize >= iBytesRead );
|
||||||
|
|
||||||
ReadBuf(szFileString, iBytesRead);
|
ReadBuf(szFileString, iBytesRead);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user