mirror of
https://github.com/AxioDL/kabufuda.git
synced 2025-05-13 10:51:20 +00:00
Specify binary mode when reopening card file
This commit is contained in:
parent
537cceca49
commit
bb972f8f36
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user