aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/fileio.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-06-14 11:33:27 +0200
committerGitHub <noreply@github.com>2024-06-14 11:33:27 +0200
commitba70404c558169b813f51d5a0bb71cd540555c93 (patch)
treeac3fc5e85d352f749413d39a855b3dac76935157 /src/nvim/os/fileio.c
parent458473acb8d641cadb238726539b119762050a47 (diff)
parent19052e0a06240be018a234d87f51113eca6d17fa (diff)
downloadrneovim-ba70404c558169b813f51d5a0bb71cd540555c93.tar.gz
rneovim-ba70404c558169b813f51d5a0bb71cd540555c93.tar.bz2
rneovim-ba70404c558169b813f51d5a0bb71cd540555c93.zip
Merge pull request #29241 from bfredl/shadapack
refactor(shada): use msgpack_sbuffer less
Diffstat (limited to 'src/nvim/os/fileio.c')
-rw-r--r--src/nvim/os/fileio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c
index 585c4964e2..89834bed80 100644
--- a/src/nvim/os/fileio.c
+++ b/src/nvim/os/fileio.c
@@ -320,9 +320,8 @@ ptrdiff_t file_write(FileDescriptor *const fp, const char *const buf, const size
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ARG(1)
{
assert(fp->wr);
- ptrdiff_t space = (fp->buffer + ARENA_BLOCK_SIZE) - fp->write_pos;
// includes the trivial case of size==0
- if (size < (size_t)space) {
+ if (size < file_space(fp)) {
memcpy(fp->write_pos, buf, size);
fp->write_pos += size;
return (ptrdiff_t)size;