mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Buildfix
This commit is contained in:
@@ -473,34 +473,6 @@ std::string GameManager::GetISOGameID(FileLoader *loader) const {
|
||||
return sfo.GetValueString("DISC_ID");
|
||||
}
|
||||
|
||||
bool ZipExtractFileToMemory(struct zip *z, int fileIndex, std::string *data) {
|
||||
struct zip_stat zstat;
|
||||
zip_stat_index(z, fileIndex, 0, &zstat);
|
||||
if (zstat.size == 0) {
|
||||
data->clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t readSize = zstat.size;
|
||||
data->resize(readSize);
|
||||
|
||||
zip_file *zf = zip_fopen_index(z, fileIndex, 0);
|
||||
if (!zf) {
|
||||
ERROR_LOG(Log::HLE, "Failed to zip_fopen_index file %d from zip", fileIndex);
|
||||
return false;
|
||||
}
|
||||
|
||||
zip_int64_t retval = zip_fread(zf, data->data(), readSize);
|
||||
zip_fclose(zf);
|
||||
|
||||
if (retval < 0 || retval < (int)readSize) {
|
||||
ERROR_LOG(Log::HLE, "Failed to read %d bytes from zip (%d) - archive corrupt?", (int)readSize, (int)retval);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool GameManager::ExtractFile(struct zip *z, int file_index, const Path &outFilename, size_t *bytesCopied, size_t allBytes) {
|
||||
struct zip_stat zstat;
|
||||
zip_stat_index(z, file_index, 0, &zstat);
|
||||
|
||||
Reference in New Issue
Block a user