summaryrefslogtreecommitdiffstats
path: root/src/spellsuggest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/spellsuggest.c')
-rw-r--r--src/spellsuggest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/spellsuggest.c b/src/spellsuggest.c
index 82499c0d19..ded04af1a4 100644
--- a/src/spellsuggest.c
+++ b/src/spellsuggest.c
@@ -509,8 +509,8 @@ spell_suggest(int count)
end_visual_mode();
// make sure we don't include the NUL at the end of the line
line = ml_get_curline();
- if (badlen > (int)STRLEN(line) - (int)curwin->w_cursor.col)
- badlen = (int)STRLEN(line) - (int)curwin->w_cursor.col;
+ if (badlen > ml_get_curline_len() - (int)curwin->w_cursor.col)
+ badlen = ml_get_curline_len() - (int)curwin->w_cursor.col;
}
// Find the start of the badly spelled word.
else if (spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL) == 0
@@ -543,7 +543,7 @@ spell_suggest(int count)
curwin->w_cursor.col);
// Make a copy of current line since autocommands may free the line.
- line = vim_strsave(ml_get_curline());
+ line = vim_strnsave(ml_get_curline(), ml_get_curline_len());
if (line == NULL)
goto skip;