Index: tools/gn/function_write_file.cc |
diff --git a/tools/gn/function_write_file.cc b/tools/gn/function_write_file.cc |
index f79416828f6882e85de177a44e570d26433a11f3..0c0dd000987e15901545ae5186c526c55be37cf6 100644 |
--- a/tools/gn/function_write_file.cc |
+++ b/tools/gn/function_write_file.cc |
@@ -76,9 +76,9 @@ Value RunWriteFile(Scope* scope, |
"I was using \"" + FilePathToUTF8(file_path.DirName()) + "\"."); |
return Value(); |
} |
- if (file_util::WriteFile(file_path, |
- contents_string.c_str(), contents_string.size()) |
- != static_cast<int>(contents_string.size())) { |
+ int int_size = static_cast<int>(contents_string.size()); |
+ if (file_util::WriteFile(file_path, contents_string.c_str(), int_size) |
+ != int_size) { |
*err = Err(function->function(), "Unable to write file.", |
"I was writing \"" + FilePathToUTF8(file_path) + "\"."); |
return Value(); |