From: Feross Aboukhadijeh Date: Mon, 25 Nov 2013 09:15:39 +0000 (-0800) Subject: Fix test failures X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=99262ac92e39ac89c05adac6d737b6c13a57115e;p=buffer.git Fix test failures --- diff --git a/index.js b/index.js index a2f490c..dca0103 100644 --- a/index.js +++ b/index.js @@ -233,7 +233,9 @@ function BufferWrite (string, offset, length, encoding) { function BufferToString (encoding, start, end) { encoding = String(encoding || 'utf8').toLowerCase() start = Number(start) || 0 - end = Number(end) || this.length + end = (end !== undefined) + ? Number(end) + : end = this.length // Fastpath empty strings if (end === start)