From 49900b445ee3889ac25a768196c3114baaef1bcd Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 24 Sep 2003 02:00:13 +0000 Subject: [PATCH] Fix assert. Always open() files with O_BINARY, so Windows doesn't mess with data. We can handle newlines on our own. --- stepmania/src/MsdFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stepmania/src/MsdFile.cpp b/stepmania/src/MsdFile.cpp index 086598213c..b17b57fff7 100644 --- a/stepmania/src/MsdFile.cpp +++ b/stepmania/src/MsdFile.cpp @@ -139,7 +139,7 @@ bool MsdFile::ReadFile( CString sNewPath ) int fd; /* Open a file. */ - if( (fd = open(sNewPath, O_RDONLY, 0)) == -1 ) + if( (fd = open(sNewPath, O_RDONLY|O_BINARY, 0)) == -1 ) { error = strerror(errno); return false; @@ -153,7 +153,7 @@ bool MsdFile::ReadFile( CString sNewPath ) int iBytesRead = read( fd, szFileString, iBufferSize ); close( fd ); - ASSERT( iBufferSize > iBytesRead ); + ASSERT( iBufferSize >= iBytesRead ); ReadBuf(szFileString, iBytesRead);