mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
updated for version 7.0113
This commit is contained in:
parent
342337a1a0
commit
63b3ce8757
@ -3349,6 +3349,9 @@ do_browse(flags, title, dflt, ext, initdir, filter, buf)
|
||||
* Length modifiers 'h' (short int) and 'l' (long int) are supported.
|
||||
* 'll' (long long int) is not supported.
|
||||
*
|
||||
* The locale is not used, the string is used as a byte string. This is only
|
||||
* relevant for double-byte encodings where the second byte may be '%'.
|
||||
*
|
||||
* It is permitted for str_m to be zero, and it is permitted to specify NULL
|
||||
* pointer for resulting string argument if str_m is zero (as per ISO C99).
|
||||
*
|
||||
@ -3417,6 +3420,7 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
|
||||
char *q = strchr(p + 1, '%');
|
||||
size_t n = (q == NULL) ? STRLEN(p) : (q - p);
|
||||
|
||||
/* Copy up to the next '%' or NUL without any changes. */
|
||||
if (str_l < str_m)
|
||||
{
|
||||
size_t avail = str_m - str_l;
|
||||
@ -4014,13 +4018,13 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
|
||||
|
||||
if (str_m > 0)
|
||||
{
|
||||
/* make sure the string is null-terminated even at the expense of
|
||||
/* make sure the string is nul-terminated even at the expense of
|
||||
* overwriting the last character (shouldn't happen, but just in case)
|
||||
* */
|
||||
str[str_l <= str_m - 1 ? str_l : str_m - 1] = '\0';
|
||||
}
|
||||
|
||||
/* Return the number of characters formatted (excluding trailing null
|
||||
/* Return the number of characters formatted (excluding trailing nul
|
||||
* character), that is, the number of characters that would have been
|
||||
* written to the buffer if it were large enough. */
|
||||
return (int)str_l;
|
||||
|
Loading…
x
Reference in New Issue
Block a user