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) {
function onRead(err, chunk) {
if (err != null) {
return cb(err, buffer, bytesRead);
return cb(err, bytesRead, buffer);
}
chunk.copy(buffer, offset);
......@@ -29,7 +29,7 @@ module.exports = function read(file, buffer, offset, length, position, cb) {
}
function readChunk() {
if (bytesRead >= length || position.ge(fileSize)) {
return cb(null, buffer, bytesRead);
return cb(null, bytesRead, buffer);
}
request(
'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