1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

fix library Buffer( to Buffer.alloc( for node 10

This commit is contained in:
Dave Conway-Jones 2018-12-13 11:32:58 +00:00
parent c283224000
commit 46a8d96997
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4

View File

@ -34,7 +34,7 @@ function getFileMeta(root,path) {
var read = 0; var read = 0;
var length = 10; var length = 10;
var remaining = ""; var remaining = "";
var buffer = Buffer(length); var buffer = Buffer.alloc(length);
while(read < size) { while(read < size) {
read+=fs.readSync(fd,buffer,0,length); read+=fs.readSync(fd,buffer,0,length);
var data = remaining+buffer.toString(); var data = remaining+buffer.toString();
@ -63,7 +63,7 @@ function getFileBody(root,path) {
var read = 0; var read = 0;
var length = 50; var length = 50;
var remaining = ""; var remaining = "";
var buffer = Buffer(length); var buffer = Buffer.alloc(length);
while(read < size) { while(read < size) {
var thisRead = fs.readSync(fd,buffer,0,length); var thisRead = fs.readSync(fd,buffer,0,length);
read += thisRead; read += thisRead;