Skip to content

Commit

Permalink
fs: fix length option being ignored during read()
Browse files Browse the repository at this point in the history
Currently, `length` in an options object is ignored.
  • Loading branch information
fracsinus committed Nov 21, 2021
1 parent 42543bc commit 4948c56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/fs/promises.js
Expand Up @@ -520,7 +520,7 @@ async function read(handle, bufferOrOptions, offset, length, position) {
buffer = Buffer.alloc(16384);
}
offset = bufferOrOptions.offset || 0;
length = buffer.byteLength;
length = bufferOrOptions.length || buffer.byteLength;
position = bufferOrOptions.position ?? null;
}

Expand Down

0 comments on commit 4948c56

Please sign in to comment.