Skip to content

Commit

Permalink
SporeModManager: use std::streamoff instead of size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Nov 29, 2023
1 parent 66434a2 commit 3ea3bf9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SporeModManager/SporeModManagerHelpers/FileVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ bool FileVersion::ParseString(std::string string, FileVersionInfo& fileVersionIn

bool FileVersion::ParseFile(std::filesystem::path path, FileVersionInfo& fileVersionInfo)
{
std::ifstream fileStream;
std::string versionString;
size_t fileStreamLength;
std::ifstream fileStream;
std::string versionString;
std::streamoff fileStreamLength;

fileStream.open(path, std::ios_base::in | std::ios_base::binary);
if (!fileStream.is_open())
Expand All @@ -141,9 +141,9 @@ bool FileVersion::ParseFile(std::filesystem::path path, FileVersionInfo& fileVer
return false;
}

std::vector<char> buffer(fileStreamLength);
std::vector<char> buffer((size_t)fileStreamLength);
fileStream.read(buffer.data(), fileStreamLength);

if (fileStream.fail())
{
std::cerr << "fileStream.fail()!" << std::endl;
Expand Down

0 comments on commit 3ea3bf9

Please sign in to comment.