diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-08 21:34:46 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-19 14:50:23 -0300 |
commit | a80d7e86c1f088c5b68d8e8929cc72a0d9680f76 (patch) | |
tree | cc9cc71ee35fe966779cf6764bd5faabd1186df3 /src/nvim/ex_cmds2.c | |
parent | b63d2626ed9e3e38a485b9990a8e65ba59d6906a (diff) | |
download | rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.tar.gz rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.tar.bz2 rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.zip |
Remove NULL/non-NULL tests after calls to vim_str(n)save()
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 3f20c59b2b..b4155b417d 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1920,8 +1920,6 @@ void ex_argedit(exarg_T *eap) if (i == ARGCOUNT) { /* Can't find it, add it to the argument list. */ s = vim_strsave(eap->arg); - if (s == NULL) - return; i = alist_add_list(1, &s, eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1); curwin->w_arg_idx = i; @@ -2252,8 +2250,8 @@ void *cookie; /* Make a copy of 'runtimepath'. Invoking the callback may change the * value. */ rtp_copy = vim_strsave(p_rtp); - buf = xmalloc(MAXPATHL); - if (rtp_copy != NULL) { + buf = xmallocz(MAXPATHL); + { if (p_verbose > 1 && name != NULL) { verbose_enter(); smsg((char_u *)_("Searching for \"%s\" in \"%s\""), @@ -2594,10 +2592,8 @@ do_source ( p = string_convert(&cookie.conv, firstline + 3, NULL); if (p == NULL) p = vim_strsave(firstline + 3); - if (p != NULL) { - free(firstline); - firstline = p; - } + free(firstline); + firstline = p; } #ifdef STARTUPTIME @@ -3483,8 +3479,6 @@ static char_u **find_locales(void) while (loc != NULL) { ga_grow(&locales_ga, 1); loc = vim_strsave(loc); - if (loc == NULL) - break; ((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] = loc; loc = (char_u *)strtok(NULL, "\n"); |