diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-03-29 01:05:04 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-31 07:31:47 -0300 |
commit | 0e998066b2533de3cf87ece1068839e60e128f1a (patch) | |
tree | 0dc09cd25ef39a59e6f9c1c41493e11bacea8f79 /src/if_cscope.c | |
parent | 7bdd1f1898c6c94326e4642d8f51f74cc14b5f9d (diff) | |
download | rneovim-0e998066b2533de3cf87ece1068839e60e128f1a.tar.gz rneovim-0e998066b2533de3cf87ece1068839e60e128f1a.tar.bz2 rneovim-0e998066b2533de3cf87ece1068839e60e128f1a.zip |
xrealloc(): similar to xmalloc()
Replaced all calls to realloc by xrealloc. All `== NULL` tests can be removed
and the code within `!= NULL` tests can be unwrapped.
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r-- | src/if_cscope.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c index 45ae82cb81..884fb002ff 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -1331,7 +1331,7 @@ static int cs_insert_filelist(char *fname, char *ppath, char *flags, struct stat } else { /* Reallocate space for more connections. */ csinfo_size *= 2; - csinfo = realloc(csinfo, sizeof(csinfo_T)*csinfo_size); + csinfo = xrealloc(csinfo, sizeof(csinfo_T)*csinfo_size); } if (csinfo == NULL) return -1; @@ -1871,7 +1871,7 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches) /* hopefully 'num' (num of matches) will be less than 10^16 */ newsize = (int)(strlen(csfmt_str) + 16 + strlen(lno)); if (bufsize < newsize) { - buf = (char *)realloc(buf, newsize); + buf = (char *)xrealloc(buf, newsize); if (buf == NULL) bufsize = 0; else @@ -1892,7 +1892,7 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches) newsize = (int)(strlen(context) + strlen(cntxformat)); if (bufsize < newsize) { - buf = (char *)realloc(buf, newsize); + buf = (char *)xrealloc(buf, newsize); if (buf == NULL) bufsize = 0; else |