summaryrefslogtreecommitdiffstats
path: root/src/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/screen.c b/src/screen.c
index 45e7c7c19a..ee61a01aea 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3649,13 +3649,19 @@ win_line(
draw_state = WL_FOLD;
if (fdc > 0)
{
- /* Draw the 'foldcolumn'. */
- fill_foldcolumn(extra, wp, FALSE, lnum);
- n_extra = fdc;
- p_extra = extra;
- p_extra[n_extra] = NUL;
- c_extra = NUL;
- char_attr = hl_attr(HLF_FC);
+ /* Draw the 'foldcolumn'. Allocate a buffer, "extra" may
+ * already be in used. */
+ p_extra_free = alloc(12 + 1);
+
+ if (p_extra_free != NULL)
+ {
+ fill_foldcolumn(p_extra_free, wp, FALSE, lnum);
+ n_extra = fdc;
+ p_extra_free[n_extra] = NUL;
+ p_extra = p_extra_free;
+ c_extra = NUL;
+ char_attr = hl_attr(HLF_FC);
+ }
}
}
#endif