Bug 516458 followup: adding the terminator to improve accuracy for short strings, rs=brendan

This commit is contained in:
David Mandelin 2009-09-21 17:00:25 -07:00
parent 127f3afdb7
commit 6b652df63e

View File

@ -2622,7 +2622,7 @@ JS_NewExternalString(JSContext *cx, jschar *chars, size_t length, intN type)
if (!str)
return NULL;
str->initFlat(chars, length);
cx->updateMallocCounter(length * sizeof(jschar));
cx->updateMallocCounter((length + 1) * sizeof(jschar));
return str;
}