Index: base/logging.cc |
diff --git a/base/logging.cc b/base/logging.cc |
index c4366d839c0c134e6f442585b698b9c4f22fb1c1..ed6b69ba7c6c134b85bc4db928ad5da2b637ad5a 100644 |
--- a/base/logging.cc |
+++ b/base/logging.cc |
@@ -609,13 +609,13 @@ LogMessage::~LogMessage() { |
} |
__android_log_write(priority, "chromium", str_newline.c_str()); |
#endif |
- fprintf(stderr, "%s", str_newline.c_str()); |
+ ignore_result(fwrite(str_newline.data(), str_newline.size(), 1, stderr)); |
fflush(stderr); |
} else if (severity_ >= kAlwaysPrintErrorLevel) { |
// When we're only outputting to a log file, above a certain log level, we |
// should still output to stderr so that we can better detect and diagnose |
// problems with unit tests, especially on the buildbots. |
- fprintf(stderr, "%s", str_newline.c_str()); |
+ ignore_result(fwrite(str_newline.data(), str_newline.size(), 1, stderr)); |
fflush(stderr); |
} |
@@ -640,7 +640,8 @@ LogMessage::~LogMessage() { |
&num_written, |
NULL); |
#else |
- fprintf(log_file, "%s", str_newline.c_str()); |
+ ignore_result(fwrite( |
+ str_newline.data(), str_newline.size(), 1, log_file)); |
fflush(log_file); |
#endif |
} |