aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorChris Watkins <chris.watkins88@gmail.com>2014-04-27 10:48:08 -0700
committerJustin M. Keyes <justinkz@gmail.com>2014-05-01 16:59:11 -0400
commit67a157c08d28810a9a7b460cb56b9e92d0d77e95 (patch)
treec8c5252a8be9a2d0546482b6336a215bb6f970bf /src/buffer.c
parent1b5217687abf8e1aeabaf4e5a64073177d56e593 (diff)
downloadrneovim-67a157c08d28810a9a7b460cb56b9e92d0d77e95.tar.gz
rneovim-67a157c08d28810a9a7b460cb56b9e92d0d77e95.tar.bz2
rneovim-67a157c08d28810a9a7b460cb56b9e92d0d77e95.zip
Replace 'alloc' with 'xmalloc' in some files.
Files changed: charset.c, buffer.c, diff.c, edit.c, ex_cmds.c, ex_cmds2.c and ex_docmd.c. The remaining alloc's in these files require more careful attention to remove.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 8723e31be3..04c331fc8b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1843,7 +1843,7 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options)
/* Make a copy of "pat" and change "^" to "\(^\|[\/]\)". */
if (*pat == '^') {
- patc = alloc((unsigned)STRLEN(pat) + 11);
+ patc = xmalloc(STRLEN(pat) + 11);
STRCPY(patc, "\\(^\\|[\\/]\\)");
STRCPY(patc + 11, pat + 1);
} else
@@ -1888,7 +1888,7 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options)
if (count == 0) /* no match found, break here */
break;
if (round == 1) {
- *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
+ *file = xmalloc(count * sizeof(**file));
}
}
vim_regfree(prog);
@@ -2520,7 +2520,7 @@ fileinfo (
char_u *buffer;
size_t len;
- buffer = alloc(IOSIZE);
+ buffer = xmalloc(IOSIZE);
if (fullname > 1) { /* 2 CTRL-G: include buffer number */
vim_snprintf((char *)buffer, IOSIZE, "buf %d: ", curbuf->b_fnum);
@@ -4285,7 +4285,7 @@ void write_viminfo_bufferlist(FILE *fp)
/* Allocate room for the file name, lnum and col. */
#define LINE_BUF_LEN (MAXPATHL + 40)
- line = alloc(LINE_BUF_LEN);
+ line = xmalloc(LINE_BUF_LEN);
FOR_ALL_TAB_WINDOWS(tp, win)
set_last_cursor(win);