mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-22 05:40:15 -06:00
Change binary stream to u8 and cast to char*
This commit is contained in:
@ -1413,7 +1413,7 @@ std::string extractROM(char* zipName, std::string zipDir){
|
|||||||
zip_stat_index(z, 0, 0, &st); //Get information about the file at index 0
|
zip_stat_index(z, 0, 0, &st); //Get information about the file at index 0
|
||||||
|
|
||||||
//Allocate memory for its uncompressed contents
|
//Allocate memory for its uncompressed contents
|
||||||
char *contents = new char[st.size];
|
u8 *contents = new u8[st.size];
|
||||||
|
|
||||||
//Read the compressed file
|
//Read the compressed file
|
||||||
zip_file *f = zip_fopen_index(z, 0, 0); //Open file at index 0
|
zip_file *f = zip_fopen_index(z, 0, 0); //Open file at index 0
|
||||||
@ -1423,7 +1423,7 @@ std::string extractROM(char* zipName, std::string zipDir){
|
|||||||
zip_close(z);
|
zip_close(z);
|
||||||
|
|
||||||
//Write the file (binary mode)
|
//Write the file (binary mode)
|
||||||
std::ofstream(zipDir + "/" + st.name, std::ofstream::binary).write(contents, st.size);
|
std::ofstream(zipDir + "/" + st.name, std::ofstream::binary).write((char*) contents, st.size);
|
||||||
delete[] contents;
|
delete[] contents;
|
||||||
return zipDir + "/" + st.name;
|
return zipDir + "/" + st.name;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user