Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Provide a more sensible default length
Currently, specifying an `offset` without a `length` throws an ERR_OUT_OF_RANGE error.  This provides a more sensible default.
This change should only affect cases where no length is specified and a nonzero offset is, which are currently throwing errors.
  • Loading branch information
wbt authored Oct 6, 2021
commit 2a9750a762edc589c0f735d63769a9e6d6c8ec65
2 changes: 1 addition & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ function read(fd, buffer, offset, length, position, callback) {
({
buffer = Buffer.alloc(16384),
offset = 0,
length = buffer.byteLength,
length = buffer.byteLength - offset,
position
} = options);
}
Expand Down