Skip to content

Commit

Permalink
Merge pull request #44 from eosnetworkfoundation/read_file_contents_b…
Browse files Browse the repository at this point in the history
…leh_31x

check for errors in fc::read_file_contents()
  • Loading branch information
spoonincode authored Jul 12, 2022
2 parents 26cffa0 + 825e1c6 commit 968cafe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/io/fstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ namespace fc {
{
const boost::filesystem::path& bfp = filename;
boost::filesystem::ifstream f( bfp, std::ios::in | std::ios::binary );
FC_ASSERT(f, "Failed to open ${filename}", ("filename", filename));
// don't use fc::stringstream here as we need something with override for << rdbuf()
std::stringstream ss;
ss << f.rdbuf();
FC_ASSERT(f, "Failed reading ${filename}", ("filename", filename));
result = ss.str();
}

Expand Down

0 comments on commit 968cafe

Please sign in to comment.