aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-14 13:35:04 +0800
committerGitHub <noreply@github.com>2024-03-14 13:35:04 +0800
commit274e414c94a74c7f90952327f69a8a1d65e9f00a (patch)
tree132b06712a25cc34f93883a9ea63c26b4ce4bf45 /src/nvim/diff.c
parent3502aa63f0f4ea8d8982aea81a819424e71029bc (diff)
parent61b48e91b941258e6945e3eafadc777dccef5b75 (diff)
downloadrneovim-274e414c94a74c7f90952327f69a8a1d65e9f00a.tar.gz
rneovim-274e414c94a74c7f90952327f69a8a1d65e9f00a.tar.bz2
rneovim-274e414c94a74c7f90952327f69a8a1d65e9f00a.zip
Merge pull request #27850 from zeertzjq/vim-9.1.0172
vim-patch:9.1.{0172,0177}: more code can use ml_get_buf_len()
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index bc91c1e4c2..c680600d39 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -756,7 +756,7 @@ static int diff_write_buffer(buf_T *buf, mmfile_t *m, linenr_T start, linenr_T e
// xdiff requires one big block of memory with all the text.
for (linenr_T lnum = start; lnum <= end; lnum++) {
- len += strlen(ml_get_buf(buf, lnum)) + 1;
+ len += (size_t)ml_get_buf_len(buf, lnum) + 1;
}
char *ptr = try_malloc(len);
if (ptr == NULL) {