Buffer.alloc to init Buffer with a length
This commit is contained in:
@@ -120,7 +120,7 @@ module.exports = class ArchiveUtil {
|
|||||||
return cb(err);
|
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) => {
|
fs.read(fd, buf, 0, buf.length, 0, (err, bytesRead) => {
|
||||||
if(err) {
|
if(err) {
|
||||||
return cb(err);
|
return cb(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user