fix 'new Buffer' warning

This commit is contained in:
Igor Klopov 2018-05-14 19:05:34 -07:00
parent a85d5b1ecf
commit 2d48c8e13f

View File

@ -197,7 +197,7 @@
+ process.argv.splice(1, 1);
+ return { undoPatch: true };
+ }
+ var prelude = new Buffer(PRELUDE_SIZE);
+ var prelude = Buffer.alloc(PRELUDE_SIZE);
+ var read = fs.readSync(fd, prelude, 0, PRELUDE_SIZE, PRELUDE_POSITION);
+ if (read !== PRELUDE_SIZE) {
+ console.error('Pkg: Error reading from file.');