Mercurial > vim
changeset 3396:43259e4542c7 v7.3.464
updated for version 7.3.464
Problem: Compiler warning for sprintf.
Solution: Put the length in a variable. (Dominique Pelle)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 07 Mar 2012 18:03:10 +0100 |
parents | c326b6833204 |
children | 5077b4eb0d61 |
files | src/version.c |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/version.c +++ b/src/version.c @@ -715,6 +715,10 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 464, +/**/ + 464, +/**/ 463, /**/ 462, @@ -2187,12 +2191,9 @@ do_intro_line(row, mesg, add_version, at /* Check for 9.9x or 9.9xx, alpha/beta version */ if (isalpha((int)vers[3])) { - if (isalpha((int)vers[4])) - sprintf((char *)vers + 5, ".%d%s", highest_patch(), - mediumVersion + 5); - else - sprintf((char *)vers + 4, ".%d%s", highest_patch(), - mediumVersion + 4); + int len = (isalpha((int)vers[4])) ? 5 : 4; + sprintf((char *)vers + len, ".%d%s", highest_patch(), + mediumVersion + len); } else sprintf((char *)vers + 3, ".%d", highest_patch());