From 84ad95fdc9d437fee711b5b8ac0acb6c1c950685 Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 6 Jun 2024 13:48:05 +0200 Subject: [PATCH] fix(fileio): copy to correct buffer position when reading fixes #29186 (likely) fixup for #29093 064483a2b --- src/nvim/os/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index c87b2d359f..5f372b2376 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -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; }