Skip to content
Merged
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
lib: 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 bebbed5414040f0b07fc8d728c9f6bda41ce270c
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