patch 9.0.0364: clang static analyzer gives warnings
Problem: Clang static analyzer gives warnings.
Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #11043)
diff --git a/src/float.c b/src/float.c
index ef9b830..aa7d697 100644
--- a/src/float.c
+++ b/src/float.c
@@ -54,12 +54,11 @@
if (skip_quotes && vim_strchr((char_u *)s, '\'') != NULL)
{
char_u buf[100];
- char_u *p = buf;
+ char_u *p;
int quotes = 0;
vim_strncpy(buf, (char_u *)s, 99);
- p = buf;
- for (;;)
+ for (p = buf; ; p = skipdigits(p))
{
// remove single quotes between digits, not in the exponent
if (*p == '\'')
@@ -69,7 +68,6 @@
}
if (!vim_isdigit(*p))
break;
- p = skipdigits(p);
}
s = (char *)buf;
f = strtod(s, &s);