diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-01 16:50:32 -0300 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-05-07 15:52:27 -0400 |
commit | 65273be0609f8f4ccc388a23b33af3333369b11d (patch) | |
tree | b1fc13f518a9d6ce69b5e1e2690ee2b9fd04dc20 /src/ex_cmds.c | |
parent | 8704a5832b6d70d0ebc3872468beaea0367f4680 (diff) | |
download | rneovim-65273be0609f8f4ccc388a23b33af3333369b11d.tar.gz rneovim-65273be0609f8f4ccc388a23b33af3333369b11d.tar.bz2 rneovim-65273be0609f8f4ccc388a23b33af3333369b11d.zip |
No OOM error in make_filter_cmd()
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 0ef98b4c2a..eb42acd93f 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -1062,8 +1062,6 @@ do_filter ( /* Create the shell command in allocated memory. */ cmd_buf = make_filter_cmd(cmd, itmp, otmp); - if (cmd_buf == NULL) - goto filterend; windgoto((int)Rows - 1, 0); cursor_on(); @@ -1314,7 +1312,7 @@ do_shell ( /* * Create a shell command from a command string, input redirection file and * output redirection file. - * Returns an allocated string with the shell command, or NULL for failure. + * Returns an allocated string with the shell command. */ char_u * make_filter_cmd ( @@ -1323,17 +1321,12 @@ make_filter_cmd ( char_u *otmp /* NULL or name of output file */ ) { - char_u *buf; - long_u len; - - len = (long_u)STRLEN(cmd) + 3; /* "()" + NUL */ + size_t len = STRLEN(cmd) + 3; /* "()" + NUL */ if (itmp != NULL) - len += (long_u)STRLEN(itmp) + 9; /* " { < " + " } " */ + len += STRLEN(itmp) + 9; /* " { < " + " } " */ if (otmp != NULL) - len += (long_u)STRLEN(otmp) + (long_u)STRLEN(p_srr) + 2; /* " " */ - buf = lalloc(len, TRUE); - if (buf == NULL) - return NULL; + len += STRLEN(otmp) + STRLEN(p_srr) + 2; /* " " */ + char_u *buf = xmalloc(len); #if defined(UNIX) /* |