You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a file descriptor fd that references a non-zero-length file, I expect this code to work:
varbuf=newBuffer(0)// Read zero bytes into offset 0 of `buf`fs.read(fd,buf,0,0,0,function(err,bytesRead,buffer){console.log('got buffer',buffer)}
Instead it throws an exception because it assumes that offset is out bounds because it starts at the end of the buffer (based on the buffer's length). If length was a positive number, this would be out of bounds. But when length is 0, an offset that starts at the end of the buffer is fine.
I expect a buffer of length zero to be returned in the callback, with no error, and no thrown exception.
The text was updated successfully, but these errors were encountered:
Given a file descriptor
fd
that references a non-zero-length file, I expect this code to work:Instead it throws an exception because it assumes that
offset
is out bounds because it starts at the end of the buffer (based on the buffer's length). Iflength
was a positive number, this would be out of bounds. But whenlength
is 0, an offset that starts at the end of the buffer is fine.I expect a buffer of length zero to be returned in the callback, with no error, and no thrown exception.
The text was updated successfully, but these errors were encountered: