Replace alloc() with xmalloc() and remove immediate OOM checks

This commit is contained in:
Felipe Oliveira Carvalho
2014-05-09 03:30:26 -03:00
parent a80d7e86c1
commit 21784aeb00
42 changed files with 413 additions and 640 deletions

View File

@@ -182,7 +182,7 @@ int set_indent(int size, int flags)
// characters and allocate accordingly. We will fill the rest with spaces
// after the if (!curbuf->b_p_et) below.
if (orig_char_len != -1) {
newline = alloc(orig_char_len + size - ind_done + line_len);
newline = xmalloc(orig_char_len + size - ind_done + line_len);
todo = size - ind_done;
// Set total length of indent in characters, which may have been
@@ -203,7 +203,7 @@ int set_indent(int size, int flags)
}
} else {
todo = size;
newline = alloc(ind_len + line_len);
newline = xmalloc(ind_len + line_len);
s = newline;
}
@@ -368,7 +368,7 @@ int copy_indent(int size, char_u *src)
// Allocate memory for the result: the copied indent, new indent
// and the rest of the line.
line_len = (int)STRLEN(ml_get_curline()) + 1;
line = alloc(ind_len + line_len);
line = xmalloc(ind_len + line_len);
p = line;
}
}