diff options
author | Reid Kleckner <rnk@google.com> | 2013-07-26 22:27:30 (GMT) |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2013-07-26 22:27:30 (GMT) |
commit | 3913d73e2025555d84f72a7c2d9b31b300535900 (patch) | |
tree | 44fd758bc1d89acba0908236e9b13d560ce124c5 | |
parent | 54b3ebd641f9d7500e9950e4c74297c00a32a6d6 (diff) | |
download | Ninja-3913d73e2025555d84f72a7c2d9b31b300535900.zip Ninja-3913d73e2025555d84f72a7c2d9b31b300535900.tar.gz Ninja-3913d73e2025555d84f72a7c2d9b31b300535900.tar.bz2 |
Use fwrite in the msvc tool instead of printf
This allows wide characters from the compiler to propagate through the
msvc tool. Similar to ad76e867f782e75e0fed620e7b39f7099af154a9.
-rw-r--r-- | src/msvc_helper_main-win32.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/msvc_helper_main-win32.cc b/src/msvc_helper_main-win32.cc index 8a0479c..ff9bc8e 100644 --- a/src/msvc_helper_main-win32.cc +++ b/src/msvc_helper_main-win32.cc @@ -129,7 +129,9 @@ int MSVCHelperMain(int argc, char** argv) { // 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], sizeof(char), output.size(), stdout); return exit_code; } |