summaryrefslogtreecommitdiffstats
path: root/src/msvc_helper_main-win32.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2013-09-12 02:14:12 (GMT)
committerEvan Martin <martine@danga.com>2013-09-12 02:15:28 (GMT)
commit63d5b1013cafb2db95687cf446eb5bb68cf6a27a (patch)
treef25d3219f9eb5e874fafed41a4042b2592ac5675 /src/msvc_helper_main-win32.cc
parent045d00847b191da46faf1c1b91368a252412bb17 (diff)
parent6f7ea464bb9161ce2e15deb97977886de152c12d (diff)
downloadNinja-1.4.0.zip
Ninja-1.4.0.tar.gz
Ninja-1.4.0.tar.bz2
v1.4.0v1.4.0
Diffstat (limited to 'src/msvc_helper_main-win32.cc')
-rw-r--r--src/msvc_helper_main-win32.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/msvc_helper_main-win32.cc b/src/msvc_helper_main-win32.cc
index 8a0479c..e3a7846 100644
--- a/src/msvc_helper_main-win32.cc
+++ b/src/msvc_helper_main-win32.cc
@@ -126,10 +126,15 @@ int MSVCHelperMain(int argc, char** argv) {
WriteDepFileOrDie(output_filename, parser);
}
+ if (output.empty())
+ return exit_code;
+
// CLWrapper's output already as \r\n line endings, make sure the C runtime
// doesn't expand this to \r\r\n.
_setmode(_fileno(stdout), _O_BINARY);
- printf("%s", output.c_str());
+ // Avoid printf and C strings, since the actual output might contain null
+ // bytes like UTF-16 does (yuck).
+ fwrite(&output[0], 1, output.size(), stdout);
return exit_code;
}