From 67a157c08d28810a9a7b460cb56b9e92d0d77e95 Mon Sep 17 00:00:00 2001 From: Chris Watkins Date: Sun, 27 Apr 2014 10:48:08 -0700 Subject: 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. --- src/buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/buffer.c') 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); -- cgit