diff src/edit.c @ 34532:64edf95a833a v9.1.0168

patch 9.1.0168: too many STRLEN() calls Commit: https://github.com/vim/vim/commit/bfcc895482c717c9f6d86890d789ec739c3016b4 Author: John Marriott <basilisk@internode.on.net> Date: Mon Mar 11 22:04:45 2024 +0100 patch 9.1.0168: too many STRLEN() calls Problem: too many STRLEN() calls Solution: Make use of ml_get_len() calls instead (John Marriott) closes: #14123 Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 11 Mar 2024 22:15:03 +0100
parents 80991201ed38
children 9e093c96dff6
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -4977,7 +4977,7 @@ ins_tab(void)
 	{
 	    pos = curwin->w_cursor;
 	    cursor = &pos;
-	    saved_line = vim_strsave(ml_get_curline());
+	    saved_line = vim_strnsave(ml_get_curline(), ml_get_curline_len());
 	    if (saved_line == NULL)
 		return FALSE;
 	    ptr = saved_line + pos.col;