diff options
Diffstat (limited to 'cmd-line-utils/libedit/vi.c')
-rw-r--r-- | cmd-line-utils/libedit/vi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd-line-utils/libedit/vi.c b/cmd-line-utils/libedit/vi.c index d628f076a1d..b1827fc98f1 100644 --- a/cmd-line-utils/libedit/vi.c +++ b/cmd-line-utils/libedit/vi.c @@ -1012,8 +1012,9 @@ vi_histedit(EditLine *el, int c __attribute__((__unused__))) if (fd < 0) return CC_ERROR; cp = el->el_line.buffer; - write(fd, cp, el->el_line.lastchar - cp +0u); - write(fd, "\n", 1); + if (write(fd, cp, el->el_line.lastchar - cp +0u) == -1 || + write(fd, "\n", 1) == -1) + return CC_ERROR; pid = fork(); switch (pid) { case -1: |