Commit 34985689 authored by Julien Fontanet's avatar Julien Fontanet

fix(read): cb params order

parent 4bb99fdd
...@@ -15,7 +15,7 @@ module.exports = function read(file, buffer, offset, length, position, cb) { ...@@ -15,7 +15,7 @@ module.exports = function read(file, buffer, offset, length, position, cb) {
function onRead(err, chunk) { function onRead(err, chunk) {
if (err != null) { if (err != null) {
return cb(err, buffer, bytesRead); return cb(err, bytesRead, buffer);
} }
chunk.copy(buffer, offset); chunk.copy(buffer, offset);
...@@ -29,7 +29,7 @@ module.exports = function read(file, buffer, offset, length, position, cb) { ...@@ -29,7 +29,7 @@ module.exports = function read(file, buffer, offset, length, position, cb) {
} }
function readChunk() { function readChunk() {
if (bytesRead >= length || position.ge(fileSize)) { if (bytesRead >= length || position.ge(fileSize)) {
return cb(null, buffer, bytesRead); return cb(null, bytesRead, buffer);
} }
request( request(
'read', 'read',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment