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

Unified Diff: src/api.cc

Issue 8318003: Change to disable stupid gcc warning. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 2 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/api.cc
===================================================================
--- src/api.cc (revision 9663)
+++ src/api.cc (working copy)
@@ -3636,8 +3636,13 @@
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) {
« 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