patch 9.1.0959: Coverity complains about type conversion
Problem: Coverity complains about type conversion
(after v9.1.0957)
Solution: use size_t instead of int for file length
(Yegappan Lakshmanan)
closes: #16297
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index d516755..4438834 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9700,7 +9700,7 @@
char_u *s;
char_u *result;
char_u *resultbuf = NULL;
- int resultlen;
+ size_t resultlen;
buf_T *buf;
int valid = VALID_HEAD + VALID_PATH; // assume valid result
int spec_idx;
@@ -9975,12 +9975,12 @@
break;
}
- resultlen = (int)STRLEN(result); // length of new string
+ resultlen = STRLEN(result); // length of new string
if (src[*usedlen] == '<') // remove the file name extension
{
++*usedlen;
if ((s = vim_strrchr(result, '.')) != NULL && s >= gettail(result))
- resultlen = (int)(s - result);
+ resultlen = s - result;
}
else if (!skip_mod)
{