diff --git a/samples/lineprocessor.cc b/samples/lineprocessor.cc index 9f5a24a63f..2e8092ee9a 100644 --- a/samples/lineprocessor.cc +++ b/samples/lineprocessor.cc @@ -404,8 +404,8 @@ v8::Handle ReadLine(const v8::Arguments& args) { } v8::Handle ReadLine() { - const int buffer_size = 1024 + 1; - char buffer[buffer_size]; + const int kBufferSize = 1024 + 1; + char buffer[kBufferSize]; char* res; { diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc index a1547e6d85..cd0da1b87a 100644 --- a/test/cctest/test-debug.cc +++ b/test/cctest/test-debug.cc @@ -2202,7 +2202,8 @@ bool GetEvaluateStringResult(char *message, char* buffer, int buffer_size) { if (pos == NULL) { return false; } - strncpy(buffer, pos, buffer_size); + Vector buf(buffer, buffer_size); + OS::StrNCpy(buf, pos, buffer_size); buffer[buffer_size - 1] = '\0'; return true; }