mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Common: Use 0 as unknown size in GetFileSize().
This commit is contained in:
parent
e6a2da69c5
commit
6b30eade31
1 changed files with 5 additions and 1 deletions
|
@ -813,6 +813,8 @@ uint64_t GetFileSize(FILE *f) {
|
|||
// Should error here.
|
||||
return 0;
|
||||
}
|
||||
if (size == -1)
|
||||
return 0;
|
||||
return size;
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
|
@ -835,6 +837,8 @@ uint64_t GetFileSize(FILE *f) {
|
|||
// Should error here.
|
||||
return 0;
|
||||
}
|
||||
if (size == -1)
|
||||
return 0;
|
||||
return size;
|
||||
#endif
|
||||
}
|
||||
|
@ -1062,7 +1066,7 @@ bool ReadFileToString(bool text_file, const Path &filename, std::string &str) {
|
|||
// Warning: some files, like in /sys/, may return a fixed size like 4096.
|
||||
size_t len = (size_t)File::GetFileSize(f);
|
||||
bool success;
|
||||
if (len == -1) {
|
||||
if (len == 0) {
|
||||
size_t totalSize = 1024;
|
||||
size_t totalRead = 0;
|
||||
do {
|
||||
|
|
Loading…
Add table
Reference in a new issue