Commit 5687d375 authored by Julien Fontanet's avatar Julien Fontanet

fix(write): properly stop when no more data to write

parent 2307e97c
...@@ -39,7 +39,7 @@ module.exports = function write(file, buffer, offset, length, start, cb) { ...@@ -39,7 +39,7 @@ module.exports = function write(file, buffer, offset, length, start, cb) {
} }
function writeChunk() { function writeChunk() {
if (length <= 0) { if (length <= 0) {
cb(null, pos - start, buffer); return cb(null, pos - start, buffer);
} }
chunkLength = Math.min(MAX_WRITE_LENGTH, length); chunkLength = Math.min(MAX_WRITE_LENGTH, length);
......
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