aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ex_cmds.c17
-rw-r--r--src/misc1.c2
2 files changed, 5 insertions, 14 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)
/*
diff --git a/src/misc1.c b/src/misc1.c
index dbe4064b47..26b649331a 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3473,8 +3473,6 @@ get_cmd_output (
/* Add the redirection stuff */
command = make_filter_cmd(cmd, infile, tempname);
- if (command == NULL)
- goto done;
/*
* Call the shell to execute the command (errors are ignored).