Merge pull request #421 from simplifi/fwrite_return_check

check return of fwrite to avoid warn_unused_result build failures. Fixed #420. Thank you.
This commit is contained in:
Milo Yip 2015-09-03 12:06:18 +08:00
commit 539e57225b

View File

@ -57,7 +57,11 @@ public:
void Flush() {
if (current_ != buffer_) {
fwrite(buffer_, 1, static_cast<size_t>(current_ - buffer_), fp_);
size_t result = fwrite(buffer_, 1, static_cast<size_t>(current_ - buffer_), fp_);
if (result < static_cast<size_t>(current_ - buffer_)) {
// failure deliberately ignored at this time
// added to avoid warn_unused_result build errors
}
current_ = buffer_;
}
}