diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-09-19 20:45:23 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-09-19 20:45:23 +0200 |
commit | 1ecfd9cb09d7cd2231940a519c1af36d9636966a (patch) | |
tree | 4dee2cd8cfd81b3acc4972ad9825a9ea543ecdd0 /src/eval.c | |
parent | 9c8d9e19523a312e888f413ca65d0863fce08f5f (diff) |
updated for version 7.4.451v7.4.451
Problem: Calling system() with empty input gives an error for writing the
temp file.
Solution: Do not try writing if the string length is zero. (Olaf Dabrunz)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 780d8834b0..8f62cb2e83 100644 --- a/src/eval.c +++ b/src/eval.c @@ -18638,13 +18638,16 @@ get_cmd_output_as_rettv(argvars, rettv, retlist) } else { + size_t len; + p = get_tv_string_buf_chk(&argvars[1], buf); if (p == NULL) { fclose(fd); goto errret; /* type error; errmsg already given */ } - if (fwrite(p, STRLEN(p), 1, fd) != 1) + len = STRLEN(p); + if (len > 0 && fwrite(p, len, 1, fd) != 1) err = TRUE; } if (fclose(fd) != 0) |