Buffer.alloc to init Buffer with a length

This commit is contained in:
David Stephens 2018-04-28 14:06:36 +01:00
parent f16eb6f3e6
commit 0d7676a871

View file

@ -120,7 +120,7 @@ module.exports = class ArchiveUtil {
return cb(err);
}
const buf = Buffer.from(this.longestSignature);
const buf = Buffer.alloc(this.longestSignature);
fs.read(fd, buf, 0, buf.length, 0, (err, bytesRead) => {
if(err) {
return cb(err);