diff --git a/src/utils.cc b/src/utils.cc index 1381c82c..bbe9390b 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -450,7 +450,8 @@ void UpdateTestExpectation(const std::string& filename, str.replace(it, expectation.size(), actual); // Write it back out. - std::ofstream of(filename, std::ios::out | std::ios::trunc); + std::ofstream of(filename, + std::ios::out | std::ios::trunc | std::ios::binary); of.write(str.c_str(), str.size()); of.close(); }