forked from aniani/vim
updated for version 7.3.160
Problem: Unsafe string copying. Solution: Use vim_strncpy() instead of strcpy(). Use vim_strcat() instead of strcat().
This commit is contained in:
14
src/misc1.c
14
src/misc1.c
@@ -3332,19 +3332,23 @@ msgmore(n)
|
||||
if (pn == 1)
|
||||
{
|
||||
if (n > 0)
|
||||
STRCPY(msg_buf, _("1 more line"));
|
||||
vim_strncpy(msg_buf, (char_u *)_("1 more line"),
|
||||
MSG_BUF_LEN - 1);
|
||||
else
|
||||
STRCPY(msg_buf, _("1 line less"));
|
||||
vim_strncpy(msg_buf, (char_u *)_("1 line less"),
|
||||
MSG_BUF_LEN - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (n > 0)
|
||||
sprintf((char *)msg_buf, _("%ld more lines"), pn);
|
||||
vim_snprintf((char *)msg_buf, MSG_BUF_LEN,
|
||||
_("%ld more lines"), pn);
|
||||
else
|
||||
sprintf((char *)msg_buf, _("%ld fewer lines"), pn);
|
||||
vim_snprintf((char *)msg_buf, MSG_BUF_LEN,
|
||||
_("%ld fewer lines"), pn);
|
||||
}
|
||||
if (got_int)
|
||||
STRCAT(msg_buf, _(" (Interrupted)"));
|
||||
vim_strcat(msg_buf, (char_u *)_(" (Interrupted)"), MSG_BUF_LEN);
|
||||
if (msg(msg_buf))
|
||||
{
|
||||
set_keep_msg(msg_buf, 0);
|
||||
|
Reference in New Issue
Block a user