aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fold.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-05-22 12:50:59 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-05-22 13:00:51 -0400
commite2e47803bdfd5fb40e3dbc9cdf798bb27d306c72 (patch)
tree6ff1b06b5d5fd6d3260f3a778c33cfaf03f0c295 /src/nvim/fold.c
parent0aa8b5828cc0674894681841f40c3c05bfd2f07b (diff)
parente303a11ebfc352860cce73184ece692ab4d0f01c (diff)
downloadrneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.gz
rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.bz2
rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.zip
Merge #708 'Remove NULL/non-NULL tests after vim_str(n)save'
- replace alloc with xmalloc
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);