Fix potential bug by casting to the POSIX specified type

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305549 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-06-16 06:17:52 +00:00
parent 73202133d9
commit 4b1c560ca3

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();