summaryrefslogtreecommitdiff
path: root/lib/string_decoder.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-06-29 09:36:50 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-06-29 19:40:20 -0700
commit5e86d013859ff749c185a1a2be46f9be05ffe5c6 (patch)
tree40bd792cd72658e7396e76edc5f9f71ae5608af3 /lib/string_decoder.js
parent0172cb39f0adc666dbe1339e16c252ad2bd94bef (diff)
downloadandroid-node-v8-5e86d013859ff749c185a1a2be46f9be05ffe5c6.tar.gz
android-node-v8-5e86d013859ff749c185a1a2be46f9be05ffe5c6.tar.bz2
android-node-v8-5e86d013859ff749c185a1a2be46f9be05ffe5c6.zip
Revert "Buffer.copy should copy through sourceEnd, as specified."
This reverts commit a2f70da4c9bf14a6e0c4a17cac11a5ab555ce90f. Keep tests modifies a few edge checks on Copy()
Diffstat (limited to 'lib/string_decoder.js')
-rw-r--r--lib/string_decoder.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/string_decoder.js b/lib/string_decoder.js
index 7bae2fc47b..2c7ace0ae5 100644
--- a/lib/string_decoder.js
+++ b/lib/string_decoder.js
@@ -25,7 +25,7 @@ StringDecoder.prototype.write = function (buffer) {
: buffer.length;
// add the new bytes to the char buffer
- buffer.copy(this.charBuffer, this.charReceived, 0, (i - 1));
+ buffer.copy(this.charBuffer, this.charReceived, 0, i);
this.charReceived += i;
if (this.charReceived < this.charLength) {
@@ -79,7 +79,7 @@ StringDecoder.prototype.write = function (buffer) {
}
// buffer the incomplete character bytes we got
- buffer.copy(this.charBuffer, 0, buffer.length - i, (buffer.length - 1));
+ buffer.copy(this.charBuffer, 0, buffer.length - i, buffer.length);
this.charReceived = i;
if (buffer.length - i > 0) {