0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.1.0643: computing byte offset wrong

Problem:    Computing byte offset wrong. (Bjorn Linse)
Solution:   Use the right variable for array index.
This commit is contained in:
Bram Moolenaar
2018-12-26 23:42:10 +01:00
parent e6fdf79980
commit 00b1e04165
3 changed files with 6 additions and 4 deletions

View File

@@ -5380,7 +5380,7 @@ ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
// lengths.
len = 0;
for (i = start_idx; i <= idx; ++i)
len += STRLEN((char_u *)dp + ((dp->db_index[idx]) & DB_INDEX_MASK)) + 1;
len += STRLEN((char_u *)dp + ((dp->db_index[i]) & DB_INDEX_MASK)) + 1;
}
else
#endif