diff --git a/lib/Support/PathV2.cpp b/lib/Support/PathV2.cpp index 4cfb650a6cc..d86c150c331 100644 --- a/lib/Support/PathV2.cpp +++ b/lib/Support/PathV2.cpp @@ -676,7 +676,7 @@ error_code has_magic(const Twine &path, const Twine &magic, bool &result) { std::FILE *file = std::fopen(Path.data(), "rb"); if (file == 0) return error_code(errno, posix_category()); - int size = ::fread(BufferStorage.data(), 1, Magic.size(), file); + size_t size = ::fread(BufferStorage.data(), 1, Magic.size(), file); if (size != Magic.size()) { int error = errno; bool eof = std::feof(file) != 0;