Fix potential bug by casting to the POSIX specified type

llvm-svn: 305549
This commit is contained in:
Eric Fiselier 2017-06-16 06:17:52 +00:00
parent da6ea0d3e8
commit 63cfb6872b
1 changed files with 1 additions and 1 deletions

View File

@ -842,7 +842,7 @@ void __rename(const path& from, const path& to, std::error_code *ec) {
}
void __resize_file(const path& p, std::uintmax_t size, std::error_code *ec) {
if (::truncate(p.c_str(), static_cast<long>(size)) == -1)
if (::truncate(p.c_str(), static_cast<::off_t>(size)) == -1)
set_or_throw(ec, "resize_file", p);
else if (ec)
ec->clear();