Skip to content

Commit

Permalink
patch 7.4.1977
Browse files Browse the repository at this point in the history
Problem:    With 64 bit changes don't need three calls to sprintf().
Solution:   Simplify the code, use vim_snprintf(). (Ken Takata)
  • Loading branch information
brammool committed Jul 1, 2016
1 parent 22fcfad commit bde9810
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
26 changes: 4 additions & 22 deletions src/fileio.c
Expand Up @@ -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)
Expand All @@ -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);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -758,6 +758,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1977,
/**/
1976,
/**/
Expand Down

0 comments on commit bde9810

Please sign in to comment.