]> granicus.if.org Git - vim/commitdiff
patch 7.4.1977 v7.4.1977
authorBram Moolenaar <Bram@vim.org>
Fri, 1 Jul 2016 18:03:42 +0000 (20:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 1 Jul 2016 18:03:42 +0000 (20:03 +0200)
Problem:    With 64 bit changes don't need three calls to sprintf().
Solution:   Simplify the code, use vim_snprintf(). (Ken Takata)

src/fileio.c
src/version.c

index 621281e850a11cae0454fa4e072b8019d8521283..fa927ff3499c19e0a24c7b0c16117e343a942979 100644 (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);
     }
 }
 
index 78ea040eda74bac4baa488287e7ca1eb66f9d48c..00b88943cea2c053a45a4e73ae9944a5824bd0aa 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1977,
 /**/
     1976,
 /**/