llvm.org GIT mirror llvm / 4828eac
Fix get_magic() handling of short reads. PR16389 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184434 91177308-0d34-0410-b5e6-96231b3b80d8 Evgeniy Stepanov 7 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
693693 if (std::ferror(file) != 0) {
694694 std::fclose(file);
695695 return error_code(errno, system_category());
696 } else if (size != result.size()) {
696 } else if (size != len) {
697697 if (std::feof(file) != 0) {
698698 std::fclose(file);
699699 result.set_size(size);
701701 }
702702 }
703703 std::fclose(file);
704 result.set_size(len);
704 result.set_size(size);
705705 return error_code::success();
706706 }
707707