1
0
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:
Bram Moolenaar
2011-04-11 16:56:35 +02:00
parent 0d35e91abf
commit ef9d6aa70d
13 changed files with 63 additions and 32 deletions

View File

@@ -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);