commit 9272dc959729ef356a24acf4eff3c411f407ffcd
parent 3341ab07764e9cda95e89880da579ea3ebb7f9b7
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue, 15 Apr 2025 08:58:00 +0800
vim-patch:9.1.1300: wrong detection of -inf (#33474)
Problem: wrong detection of -inf
Solution: correctly compare 4 characters and not 3
(John Marriott)
closes: vim/vim#17109
https://github.com/vim/vim/commit/10f69298b4577b3712eedeb49b4d9ad1a69111f8
Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
@@ -5323,7 +5323,7 @@ size_t string2float(const char *const text, float_T *const ret_value)
*ret_value = (float_T)INFINITY;
return 3;
}
- if (STRNICMP(text, "-inf", 3) == 0) {
+ if (STRNICMP(text, "-inf", 4) == 0) {
*ret_value = (float_T)(-INFINITY);
return 4;
}