From 004b45d6f5a447369f14074f4d0dd7ce2cf672fb Mon Sep 17 00:00:00 2001 From: Douglas Schneider Date: Mon, 26 May 2014 17:03:28 -0600 Subject: Replace vim_strncpy calls: screen.c --- src/nvim/screen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 0a10def170..0dab25a21a 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5082,11 +5082,11 @@ win_redr_custom ( /* Make all characters printable. */ p = transstr(buf); - vim_strncpy(buf, p, sizeof(buf) - 1); + len = STRLCPY(buf, p, sizeof(buf)); + len = (size_t)len < sizeof(buf) ? len : (int)sizeof(buf) - 1; free(p); /* fill up with "fillchar" */ - len = (int)STRLEN(buf); while (width < maxwidth && len < (int)sizeof(buf) - 1) { len += (*mb_char2bytes)(fillchar, buf + len); ++width; @@ -7626,7 +7626,7 @@ static void draw_tabline(void) void get_trans_bufname(buf_T *buf) { if (buf_spname(buf) != NULL) - vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1); + STRLCPY(NameBuff, buf_spname(buf), MAXPATHL); else home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE); trans_characters(NameBuff, MAXPATHL); -- cgit