Commit bb972f8f authored by Jack Andersen's avatar Jack Andersen

Specify binary mode when reopening card file

parent 537cceca
......@@ -524,6 +524,11 @@ public:
*/
void close();
/**
* @brief Access host filename of card
*/
const SystemString& cardFilename() const { return m_filename; }
/**
* @brief Gets card-scope error state
* @return READY, BROKEN, or NOCARD
......
......@@ -117,7 +117,7 @@ Card::Card(const SystemString& filename, const char* game, const char* maker) :
/* Close and reopen in read/write mode */
fclose(m_fileHandle);
m_fileHandle = Fopen(m_filename.c_str(), _S("r+"));
m_fileHandle = Fopen(m_filename.c_str(), _S("r+b"));
rewind(m_fileHandle);
}
}
......@@ -949,7 +949,7 @@ void Card::format(ECardSlot id, ECardSize size, EEncoding encoding)
memset(data.get(), 0xFF, dataLen);
fwrite(data.get(), 1, dataLen, m_fileHandle);
fclose(m_fileHandle);
m_fileHandle = Fopen(m_filename.c_str(), _S("r+"));
m_fileHandle = Fopen(m_filename.c_str(), _S("r+b"));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment