Corrected wxFFileStream to use binary mode.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -76,7 +76,8 @@ size_t wxFileInputStream::OnSysRead(void *buffer, size_t size)
|
|||||||
m_lasterror = wxStream_NOERROR;
|
m_lasterror = wxStream_NOERROR;
|
||||||
if (m_file->Eof())
|
if (m_file->Eof())
|
||||||
m_lasterror = wxStream_EOF;
|
m_lasterror = wxStream_EOF;
|
||||||
if (ret == wxInvalidOffset) {
|
if (ret == wxInvalidOffset)
|
||||||
|
{
|
||||||
m_lasterror = wxStream_READ_ERR;
|
m_lasterror = wxStream_READ_ERR;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
@@ -125,7 +126,8 @@ wxFileOutputStream::wxFileOutputStream(int fd)
|
|||||||
|
|
||||||
wxFileOutputStream::~wxFileOutputStream()
|
wxFileOutputStream::~wxFileOutputStream()
|
||||||
{
|
{
|
||||||
if (m_file_destroy) {
|
if (m_file_destroy)
|
||||||
|
{
|
||||||
Sync();
|
Sync();
|
||||||
delete m_file;
|
delete m_file;
|
||||||
}
|
}
|
||||||
@@ -221,7 +223,8 @@ size_t wxFFileInputStream::OnSysRead(void *buffer, size_t size)
|
|||||||
|
|
||||||
if (m_file->Eof())
|
if (m_file->Eof())
|
||||||
m_lasterror = wxStream_EOF;
|
m_lasterror = wxStream_EOF;
|
||||||
if (ret == wxInvalidOffset) {
|
if (ret == wxInvalidOffset)
|
||||||
|
{
|
||||||
m_lasterror = wxStream_READ_ERR;
|
m_lasterror = wxStream_READ_ERR;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
@@ -245,7 +248,7 @@ off_t wxFFileInputStream::OnSysTell() const
|
|||||||
|
|
||||||
wxFFileOutputStream::wxFFileOutputStream(const wxString& fileName)
|
wxFFileOutputStream::wxFFileOutputStream(const wxString& fileName)
|
||||||
{
|
{
|
||||||
m_file = new wxFFile(fileName, "w+");
|
m_file = new wxFFile(fileName, "w+b");
|
||||||
m_file_destroy = TRUE;
|
m_file_destroy = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +273,8 @@ wxFFileOutputStream::wxFFileOutputStream(FILE *file)
|
|||||||
|
|
||||||
wxFFileOutputStream::~wxFFileOutputStream()
|
wxFFileOutputStream::~wxFFileOutputStream()
|
||||||
{
|
{
|
||||||
if (m_file_destroy) {
|
if (m_file_destroy)
|
||||||
|
{
|
||||||
Sync();
|
Sync();
|
||||||
delete m_file;
|
delete m_file;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user