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

Unified Diff: src/top.cc

Issue 1940: Replaced calls to functions that msvc consider deprecated. Used... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 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 | « src/string-stream.cc ('k') | src/utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/top.cc
===================================================================
--- src/top.cc (revision 280)
+++ src/top.cc (working copy)
@@ -124,11 +124,11 @@
// When the thread starts running it will allocate a fixed number of bytes
// on the stack and publish the location of this memory for others to use.
void Run() {
- char local_buffer[16 * 1024];
+ EmbeddedVector<char, 16 * 1024> local_buffer;
// Initialize the buffer with a known good value.
- strncpy(local_buffer, "Trace data was not generated.\n",
- sizeof(local_buffer));
+ OS::StrNCpy(local_buffer, "Trace data was not generated.\n",
+ local_buffer.length());
// Publish the local buffer and signal its availability.
data_ = &local_buffer[0];
@@ -142,8 +142,8 @@
// Make sure we access the buffer after the wait to remove all possibility
// of it being optimized away.
- strncpy(local_buffer, "PreallocatedMemoryThread shutting down.\n",
- sizeof(local_buffer));
+ OS::StrNCpy(local_buffer, "PreallocatedMemoryThread shutting down.\n",
+ local_buffer.length());
}
static char* data() {
« no previous file with comments | « src/string-stream.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698