vim-patch:9.1.0449: MS-Windows: Compiler warnings

Problem:  MS-Windows: Compiler warnings
Solution: Resolve size_t to int warnings

closes: vim/vim#14874

A couple of warnings in ex_docmd.c have been resolved by modifying their
function argument types, followed by some changes in various function
call sites.  This also allowed removal of some casts to cope with
size_t/int conversion.

51024bbc1a

Co-authored-by: Mike Williams <mrmrdubya@gmail.com>
This commit is contained in:
zeertzjq
2024-05-30 13:57:41 +08:00
parent 783f6079b8
commit df2c3b204b

View File

@@ -266,11 +266,11 @@ char *vim_strsave_shellescape(const char *string, bool do_special, bool do_newli
*d++ = *p++;
continue;
}
if (do_special && find_cmdline_var(p, &l) >= 0) {
if (do_special && find_cmdline_var(p, &l) >= 0 && l > 0) {
*d++ = '\\'; // insert backslash
while (--l != SIZE_MAX) { // copy the var
do { // copy the var
*d++ = *p++;
}
} while (--l > 0);
continue;
}
if (*p == '\\' && fish_like) {