summaryrefslogtreecommitdiffstats
path: root/src/float.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-09-03 10:52:24 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-03 10:52:24 +0100
commitc99e182e1fb54e39540d25d0ccd8dcdde25bb96c (patch)
treed0cec00ea2cd55d8fb68d353712b70d8be952e5f /src/float.c
parentb18b49699776485150b71626069a40d12d2c5590 (diff)
patch 9.0.0364: clang static analyzer gives warningsv9.0.0364
Problem: Clang static analyzer gives warnings. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #11043)
Diffstat (limited to 'src/float.c')
-rw-r--r--src/float.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/float.c b/src/float.c
index ef9b8309e0..aa7d697c6f 100644
--- a/src/float.c
+++ b/src/float.c
@@ -54,12 +54,11 @@ string2float(
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 @@ string2float(
}
if (!vim_isdigit(*p))
break;
- p = skipdigits(p);
}
s = (char *)buf;
f = strtod(s, &s);