From: Daniel Cousens Date: Sat, 24 May 2014 09:32:47 +0000 (+1000) Subject: use writeInt8 when reading from an array X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=9f4578b59c1f5913e967416c60395fb5c38c6a53;p=buffer.git use writeInt8 when reading from an array --- diff --git a/index.js b/index.js index b1375ff..92769c9 100644 --- a/index.js +++ b/index.js @@ -94,7 +94,7 @@ function Buffer (subject, encoding, noZero) { if (Buffer.isBuffer(subject)) buf[i] = subject.readUInt8(i) else - buf[i] = subject[i] + buf.writeInt8(subject[i], i) } } else if (type === 'string') { buf.write(subject, 0, encoding)