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/diff.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/diff.c') diff --git a/src/diff.c b/src/diff.c index 74e145f96c..880ae9edef 100644 --- a/src/diff.c +++ b/src/diff.c @@ -462,7 +462,7 @@ static void diff_mark_adjust_tp(tabpage_T *tp, int idx, linenr_T line1, /// @return The new diff block. static diff_T* diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp) { - diff_T *dnew = (diff_T *)alloc((unsigned)sizeof(diff_T)); + diff_T *dnew = xmalloc(sizeof(*dnew)); dnew->df_next = dp; if (dprev == NULL) { @@ -819,7 +819,7 @@ static void diff_file(char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff) } else { size_t len = STRLEN(tmp_orig) + STRLEN(tmp_new) + STRLEN(tmp_diff) + STRLEN(p_srr) + 27; - char_u *cmd = alloc((unsigned)len); + char_u *cmd = xmalloc(len); /* We don't want $DIFF_OPTIONS to get in the way. */ if (os_getenv("DIFF_OPTIONS")) { @@ -895,7 +895,7 @@ void ex_diffpatch(exarg_T *eap) size_t buflen = STRLEN(tmp_orig) + (STRLEN(eap->arg)) + STRLEN(tmp_new) + 16; #endif // ifdef UNIX - buf = alloc((unsigned)buflen); + buf = xmalloc(buflen); #ifdef UNIX -- cgit