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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user