Skip to content

Commit

Permalink
read_file: fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Jul 21, 2024
1 parent a778940 commit b6f0f7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/utl/read_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ inline std::optional<std::string> read_file(char const* path) {
f.seekg(0, std::ios::beg);

std::string buffer;
buffer.resize(size);
buffer.resize(static_cast<std::size_t>(size));

return f.read(&buffer[0], size) ? std::make_optional(buffer) : std::nullopt;
} catch (std::exception const& e) {
} catch (std::exception const&) {
return std::nullopt;
}
}
Expand Down

0 comments on commit b6f0f7a

Please sign in to comment.