From 9f4578b59c1f5913e967416c60395fb5c38c6a53 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sat, 24 May 2014 19:32:47 +1000 Subject: [PATCH] use writeInt8 when reading from an array --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.34.1