aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-08 21:34:46 -0300
committerFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-19 14:50:23 -0300
commita80d7e86c1f088c5b68d8e8929cc72a0d9680f76 (patch)
treecc9cc71ee35fe966779cf6764bd5faabd1186df3 /src/nvim/ex_getln.c
parentb63d2626ed9e3e38a485b9990a8e65ba59d6906a (diff)
downloadrneovim-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_getln.c')
-rw-r--r--src/nvim/ex_getln.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 99915525ae..63952f8781 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1196,8 +1196,7 @@ getcmdline (
/* save current command string so it can be restored later */
if (lookfor == NULL) {
- if ((lookfor = vim_strsave(ccline.cmdbuff)) == NULL)
- goto cmdline_not_changed;
+ lookfor = vim_strsave(ccline.cmdbuff);
lookfor[ccline.cmdpos] = NUL;
}
@@ -4510,8 +4509,7 @@ add_to_history (
/* Store the separator after the NUL of the string. */
len = (int)STRLEN(new_entry);
hisptr->hisstr = vim_strnsave(new_entry, len + 2);
- if (hisptr->hisstr != NULL)
- hisptr->hisstr[len + 1] = sep;
+ hisptr->hisstr[len + 1] = sep;
hisptr->hisnum = ++hisnum[histype];
hisptr->viminfo = FALSE;