aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-10 00:50:47 -0300
committerFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-19 14:50:24 -0300
commiteb636858b5c30709f9fb7f0b49ce7617d9d3985f (patch)
tree8a6f33a58b4c1bac8c85cabb15d248a8ca5eae06 /src/nvim/ex_getln.c
parent1ca3368ce3ec6da2acda91ac8b1d00399d10b045 (diff)
downloadrneovim-eb636858b5c30709f9fb7f0b49ce7617d9d3985f.tar.gz
rneovim-eb636858b5c30709f9fb7f0b49ce7617d9d3985f.tar.bz2
rneovim-eb636858b5c30709f9fb7f0b49ce7617d9d3985f.zip
Remove OOM checks: alloc_cmdbuff()
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index a6c1e6d563..442e7d8164 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -232,8 +232,6 @@ getcmdline (
/* alloc initial ccline.cmdbuff */
alloc_cmdbuff(exmode_active ? 250 : indent + 1);
- if (ccline.cmdbuff == NULL)
- return NULL; /* out of memory */
ccline.cmdlen = ccline.cmdpos = 0;
ccline.cmdbuff[0] = NUL;
@@ -1285,15 +1283,11 @@ getcmdline (
}
if (i == 0) {
alloc_cmdbuff(len);
- if (ccline.cmdbuff == NULL)
- goto returncmd;
}
}
ccline.cmdbuff[len] = NUL;
} else {
alloc_cmdbuff((int)STRLEN(p));
- if (ccline.cmdbuff == NULL)
- goto returncmd;
STRCPY(ccline.cmdbuff, p);
}
@@ -1999,7 +1993,6 @@ static void alloc_cmdbuff(int len)
/*
* Re-allocate the command line to length len + something extra.
- * return FAIL for failure, OK otherwise
*/
static int realloc_cmdbuff(int len)
{
@@ -2010,10 +2003,6 @@ static int realloc_cmdbuff(int len)
p = ccline.cmdbuff;
alloc_cmdbuff(len); /* will get some more */
- if (ccline.cmdbuff == NULL) { /* out of memory */
- ccline.cmdbuff = p; /* keep the old one */
- return FAIL;
- }
/* There isn't always a NUL after the command, but it may need to be
* there, thus copy up to the NUL and add a NUL. */
memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen);