Skip to content

Commit 0346889

Browse files
committed
Added a cast to suppress MSVC warning of a possible truncation.
1 parent 47a4e69 commit 0346889

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/boost/filesystem/string_file.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ inline void load_string_file(path const& p, std::string& str)
5353
const boost::uintmax_t sz = filesystem::file_size(p);
5454
if (BOOST_UNLIKELY(sz > static_cast< boost::uintmax_t >((std::numeric_limits< std::streamsize >::max)())))
5555
BOOST_FILESYSTEM_THROW(std::length_error("File size exceeds max read size"));
56-
str.resize(sz, '\0');
56+
str.resize(static_cast< std::size_t >(sz), '\0');
5757
if (sz > 0u)
5858
file.read(&str[0], static_cast< std::streamsize >(sz));
5959
}

0 commit comments

Comments
 (0)