patch 8.1.0975: using STRNCPY() wrongly. Warning for uninitialized variable
Problem: Using STRNCPY() wrongly. Warning for uninitialized variable.
Solution: Use mch_memmove(). Initialize variable. (Yasuhiro Matsumoto,
closes #3979)
diff --git a/src/screen.c b/src/screen.c
index 4973b51..aade363 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2547,10 +2547,10 @@
{
#ifdef FEAT_RIGHTLEFT
if (wp->w_p_rl)
- STRNCPY(current_ScreenLine, text, len);
+ mch_memmove(current_ScreenLine, text, len);
else
#endif
- STRNCPY(current_ScreenLine + col, text, len);
+ mch_memmove(current_ScreenLine + col, text, len);
col += len;
}
}
@@ -3396,7 +3396,7 @@
{
if (lnum == curwin->w_cursor.lnum)
getvcol(curwin, &(curwin->w_cursor),
- (colnr_T *)&fromcol, NULL, NULL);
+ (colnr_T *)&fromcol, NULL, NULL);
else
fromcol = 0;
if (lnum == curwin->w_cursor.lnum + search_match_lines)