0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 7.4.1977

Problem:    With 64 bit changes don't need three calls to sprintf().
Solution:   Simplify the code, use vim_snprintf(). (Ken Takata)
This commit is contained in:
Bram Moolenaar
2016-07-01 20:03:42 +02:00
parent 22fcfad292
commit bde9810d61
2 changed files with 6 additions and 22 deletions

View File

@@ -5231,17 +5231,8 @@ msg_add_lines(
if (insert_space)
*p++ = ' ';
if (shortmess(SHM_LINES))
#ifdef LONG_LONG_OFF_T
sprintf((char *)p,
"%ldL, %lldC", lnum, (long long)nchars);
#elif defined(WIN3264)
sprintf((char *)p,
"%ldL, %I64dC", lnum, (__int64)nchars);
#else
sprintf((char *)p,
/* Explicit typecast avoids warning on Mac OS X 10.6 */
"%ldL, %ldC", lnum, (long)nchars);
#endif
vim_snprintf((char *)p, IOSIZE - (p - IObuff),
"%ldL, %lldC", lnum, (varnumber_T)nchars);
else
{
if (lnum == 1)
@@ -5252,17 +5243,8 @@ msg_add_lines(
if (nchars == 1)
STRCPY(p, _("1 character"));
else
#ifdef LONG_LONG_OFF_T
sprintf((char *)p,
_("%lld characters"), (long long)nchars);
#elif defined(WIN3264)
sprintf((char *)p,
_("%I64d characters"), (__int64)nchars);
#else
sprintf((char *)p,
/* Explicit typecast avoids warning on Mac OS X 10.6 */
_("%ld characters"), (long)nchars);
#endif
vim_snprintf((char *)p, IOSIZE - (p - IObuff),
_("%lld characters"), (varnumber_T)nchars);
}
}

View File

@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1977,
/**/
1976,
/**/