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>
This commit is contained in:
Yegappan Lakshmanan
2024-12-25 10:20:51 +01:00
committed by Christian Brabandt
parent 9739086de2
commit 00d3459ea6
6 changed files with 37 additions and 33 deletions

View File

@ -9700,7 +9700,7 @@ eval_vars(
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 @@ eval_vars(
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)
{