mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
Merge pull request #29221 from bfredl/filebuffix
fix(fileio): copy to correct buffer position when reading
This commit is contained in:
@@ -300,7 +300,7 @@ ptrdiff_t file_read(FileDescriptor *const fp, char *const ret_buf, const size_t
|
||||
} else {
|
||||
fp->write_pos += r_ret;
|
||||
size_t to_copy = MIN((size_t)r_ret, read_remaining);
|
||||
memcpy(ret_buf, fp->read_pos, to_copy);
|
||||
memcpy(buf, fp->read_pos, to_copy);
|
||||
fp->read_pos += to_copy;
|
||||
read_remaining -= to_copy;
|
||||
}
|
||||
|
Reference in New Issue
Block a user