Commit b90ec2f3 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Change to disable stupid gcc warning.

Review URL: http://codereview.chromium.org/8318003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9664 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 18125191
......@@ -3636,8 +3636,13 @@ int String::WriteUtf8(char* buffer,
ENTER_V8(isolate);
i::Handle<i::String> str = Utils::OpenHandle(this);
if (str->IsAsciiRepresentation()) {
if (capacity == -1) capacity = str->length() + 1;
int len = i::Min(capacity, str->length());
int len;
if (capacity == -1) {
capacity = str->length() + 1;
len = str->length();
} else {
len = i::Min(capacity, str->length());
}
i::String::WriteToFlat(*str, buffer, 0, len);
if (nchars_ref != NULL) *nchars_ref = len;
if (!(options & NO_NULL_TERMINATION) && capacity > len) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment