mirror of
https://github.com/boostorg/filesystem.git
synced 2026-01-19 04:12:09 +00:00
Added a cast to suppress MSVC warning of a possible truncation.
This commit is contained in:
@@ -53,7 +53,7 @@ inline void load_string_file(path const& p, std::string& str)
|
||||
const boost::uintmax_t sz = filesystem::file_size(p);
|
||||
if (BOOST_UNLIKELY(sz > static_cast< boost::uintmax_t >((std::numeric_limits< std::streamsize >::max)())))
|
||||
BOOST_FILESYSTEM_THROW(std::length_error("File size exceeds max read size"));
|
||||
str.resize(sz, '\0');
|
||||
str.resize(static_cast< std::size_t >(sz), '\0');
|
||||
if (sz > 0u)
|
||||
file.read(&str[0], static_cast< std::streamsize >(sz));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user