summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/PathV2.inc
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Unix/PathV2.inc')
-rw-r--r--llvm/lib/Support/Unix/PathV2.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/PathV2.inc b/llvm/lib/Support/Unix/PathV2.inc
index 9602daad08f..39b33123de8 100644
--- a/llvm/lib/Support/Unix/PathV2.inc
+++ b/llvm/lib/Support/Unix/PathV2.inc
@@ -694,7 +694,7 @@ error_code get_magic(const Twine &path, uint32_t len,
if (std::ferror(file) != 0) {
std::fclose(file);
return error_code(errno, system_category());
- } else if (size != result.size()) {
+ } else if (size != len) {
if (std::feof(file) != 0) {
std::fclose(file);
result.set_size(size);
@@ -702,7 +702,7 @@ error_code get_magic(const Twine &path, uint32_t len,
}
}
std::fclose(file);
- result.set_size(len);
+ result.set_size(size);
return error_code::success();
}
OpenPOWER on IntegriCloud