summaryrefslogtreecommitdiffstats
path: root/src/fold.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-01-27 21:03:12 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-27 21:03:12 +0000
commitfadc02a2a57755fa1342b1b44c2ceab3046125fc (patch)
tree8e013a61d40bcca51deff9aa21cda2c51b96f41f /src/fold.c
parent8dbab1d8ceb82a0fb693a1b7fcb57a2dfb4de068 (diff)
patch 9.0.1251: checking returned value of ga_grow() is inconsistentv9.0.1251
Problem: Checking returned value of ga_grow() is inconsistent. Solution: Check for FAIL instaed of "not OK". (Yegappan Lakshmanan, closes #11897)
Diffstat (limited to 'src/fold.c')
-rw-r--r--src/fold.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fold.c b/src/fold.c
index 589727d989..be20991c7a 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -645,7 +645,7 @@ foldCreate(linenr_T start, linenr_T end)
i = (int)(fp - (fold_T *)gap->ga_data);
}
- if (ga_grow(gap, 1) != OK)
+ if (ga_grow(gap, 1) == FAIL)
return;
fp = (fold_T *)gap->ga_data + i;
@@ -2884,7 +2884,7 @@ foldInsert(garray_T *gap, int i)
{
fold_T *fp;
- if (ga_grow(gap, 1) != OK)
+ if (ga_grow(gap, 1) == FAIL)
return FAIL;
fp = (fold_T *)gap->ga_data + i;
if (gap->ga_len > 0 && i < gap->ga_len)