aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
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) {