summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--exec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index 269ad07..c9302c2 100644
--- a/exec.c
+++ b/exec.c
@@ -327,9 +327,13 @@ static void bfs_exec_closewd(struct bfs_exec *execbuf, const struct BFTW *ftwbuf
static int bfs_exec_spawn(const struct bfs_exec *execbuf) {
if (execbuf->flags & BFS_EXEC_CONFIRM) {
for (size_t i = 0; i < execbuf->argc; ++i) {
- fprintf(stderr, "%s ", execbuf->argv[i]);
+ if (fprintf(stderr, "%s ", execbuf->argv[i]) < 0) {
+ return -1;
+ }
+ }
+ if (fprintf(stderr, "? ") < 0) {
+ return -1;
}
- fprintf(stderr, "? ");
if (ynprompt() <= 0) {
errno = 0;