Explorar o código

Merge pull request #1170 from lioncash/ret

file_util: Correct return value in early exit of ReadFileToString()
bunnei %!s(int64=8) %!d(string=hai) anos
pai
achega
2562fe4a16
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/common/file_util.cpp

+ 1 - 1
src/common/file_util.cpp

@@ -764,7 +764,7 @@ size_t ReadFileToString(bool text_file, const char* filename, std::string& str)
     IOFile file(filename, text_file ? "r" : "rb");
 
     if (!file.IsOpen())
-        return false;
+        return 0;
 
     str.resize(static_cast<u32>(file.GetSize()));
     return file.ReadArray(&str[0], str.size());