diff options
author | Maxim Kalaev <maximk@il.ibm.com> | 2012-06-28 06:34:19 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-07-27 17:36:28 (GMT) |
commit | 547998bc63640abc71573d94bc6afb11f74c13bc (patch) | |
tree | 6abfe96eec18a5fa775d7b13a71201b3ea5b8ab3 /src | |
parent | 69d94732ad63fe5d73fe18972eb48225bcaadf98 (diff) | |
download | Ninja-547998bc63640abc71573d94bc6afb11f74c13bc.zip Ninja-547998bc63640abc71573d94bc6afb11f74c13bc.tar.gz Ninja-547998bc63640abc71573d94bc6afb11f74c13bc.tar.bz2 |
Minor: zero log buffer before reading data/parsing it
Not a real problem, mainly to make valgrind happy
Diffstat (limited to 'src')
-rw-r--r-- | src/build_log.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/build_log.cc b/src/build_log.cc index 5eddf8f..1b27be3 100644 --- a/src/build_log.cc +++ b/src/build_log.cc @@ -164,7 +164,9 @@ void BuildLog::Close() { class LineReader { public: explicit LineReader(FILE* file) - : file_(file), buf_end_(buf_), line_start_(buf_), line_end_(NULL) {} + : file_(file), buf_end_(buf_), line_start_(buf_), line_end_(NULL) { + memset(buf_, 0, sizeof(buf_)); + } // Reads a \n-terminated line from the file passed to the constructor. // On return, *line_start points to the beginning of the next line, and |