diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-12-26 23:42:10 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-12-26 23:42:10 +0100 |
commit | 00b1e041654e8a38fb6b81218a037e1dc94e0943 (patch) | |
tree | cc89e87c49d55bb9e463fad7ab0a0f73068c6f9a /src/memline.c | |
parent | e6fdf79980c0f2856700d4f46de700293f477429 (diff) |
patch 8.1.0643: computing byte offset wrongv8.1.0643
Problem: Computing byte offset wrong. (Bjorn Linse)
Solution: Use the right variable for array index.
Diffstat (limited to 'src/memline.c')
-rw-r--r-- | src/memline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/memline.c b/src/memline.c index d79e7ce8c0..6b4a766346 100644 --- a/src/memline.c +++ b/src/memline.c @@ -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 |