Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Unified Diff: src/log-utils.cc

Issue 214020: Fix Windows build. My mistake for not trying it our prior to submitting. (Closed)
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log-utils.cc
diff --git a/src/log-utils.cc b/src/log-utils.cc
index f280bfbe28a2a3ecc853cf5620b1a42d39fca5a0..dcb4b499e6555ec1741506f8d1c347b145056dc2 100644
--- a/src/log-utils.cc
+++ b/src/log-utils.cc
@@ -316,7 +316,9 @@ void LogMessageBuilder::AppendStringPart(const char* str, int len) {
ASSERT(len >= 0);
if (len == 0) return;
}
- strncpy(Log::message_buffer_ + pos_, str, len);
+ Vector<char> buf(Log::message_buffer_ + pos_,
+ Log::kMessageBufferSize - pos_);
+ OS::StrNCpy(buf, str, len);
pos_ += len;
ASSERT(pos_ <= Log::kMessageBufferSize);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698