Fix zerocoder, use buffers instead of strings for vardata, add util for null-terminated string<->buffer conversion

This commit is contained in:
Casper Warden
2017-11-26 19:47:41 +00:00
parent 3f25aa0f1b
commit fc6d77a893
195 changed files with 2005 additions and 1881 deletions

View File

@@ -25,8 +25,9 @@ export class Zerocoder
bytes += (zero - 2);
}
const newBuf = Buffer.allocUnsafe((end + 1) - bytes);
buf.copy(newBuf, 0, 0, start - 1);
const newBuf = Buffer.allocUnsafe(end - bytes);
buf.copy(newBuf, 0, 0, start);
let newBufIndex = start;
zero = 0;
for (let i = start; i <= end; i++)