patch 9.1.0449: MS-Windows: Compiler warnings
Problem: MS-Windows: Compiler warnings
Solution: Resolve size_t to int warnings
closes: #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.
Signed-off-by: Mike Williams <mrmrdubya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/strings.c b/src/strings.c
index 33de175..9b66ee0 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -151,7 +151,7 @@
char_u *p;
char_u *d;
char_u *escaped_string;
- int l;
+ size_t l;
int csh_like;
int fish_like;
char_u *shname;
@@ -269,11 +269,12 @@
*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 >= 0) // copy the var
+ do // copy the var
*d++ = *p++;
+ while (--l > 0);
continue;
}
if (*p == '\\' && fish_like)