aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-05-22 12:50:59 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-05-22 13:00:51 -0400
commite2e47803bdfd5fb40e3dbc9cdf798bb27d306c72 (patch)
tree6ff1b06b5d5fd6d3260f3a778c33cfaf03f0c295 /src/nvim/ex_cmds2.c
parent0aa8b5828cc0674894681841f40c3c05bfd2f07b (diff)
parente303a11ebfc352860cce73184ece692ab4d0f01c (diff)
downloadrneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.gz
rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.bz2
rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.zip
Merge #708 'Remove NULL/non-NULL tests after vim_str(n)save'
- replace alloc with xmalloc
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r--src/nvim/ex_cmds2.c14
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");