aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fold.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/fold.c')
-rw-r--r--src/nvim/fold.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index d12d364f49..1215d5b24d 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -1610,7 +1610,7 @@ static void foldAddMarker(linenr_T lnum, char_u *marker, int markerlen)
line_len = (int)STRLEN(line);
if (u_save(lnum - 1, lnum + 1) == OK) {
- newline = alloc((unsigned)(line_len + markerlen + STRLEN(cms) + 1));
+ newline = xmalloc(line_len + markerlen + STRLEN(cms) + 1);
STRCPY(newline, line);
if (p == NULL)
vim_strncpy(newline + line_len, marker, markerlen);
@@ -1681,7 +1681,7 @@ static void foldDelMarker(linenr_T lnum, char_u *marker, int markerlen)
}
if (u_save(lnum - 1, lnum + 1) == OK) {
/* Make new line: text-before-marker + text-after-marker */
- newline = alloc((unsigned)(STRLEN(line) - len + 1));
+ newline = xmalloc(STRLEN(line) - len + 1);
STRNCPY(newline, line, p - line);
STRCPY(newline + (p - line), p + len);
ml_replace(lnum, newline, FALSE);