fix deprecated usage of Buffer constructor

This commit is contained in:
Brian Gough
2020-05-07 10:42:05 +01:00
parent 7254a025ae
commit 3592ffda52
3 changed files with 5 additions and 6 deletions

View File

@@ -43,7 +43,7 @@ module.exports = SafeReader = {
}
return callback(null, ...Array.from(result))
})
const buff = new Buffer(size, 0) // fill with zeros
const buff = Buffer.alloc(size) // fills with zeroes by default
return fs.read(fd, buff, 0, buff.length, 0, function(
err,
bytesRead,