From: Teemu Hukkanen <tjhukkan@iki.fi>
Date: Sat, 16 Mar 2024 16:04:36 +0200
Subject: Fix stdin-stdout option

Origin: upstream
Bug-Debian: http://bugs.debian.org/429885
Forwarded: not-needed
---
 common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common.c b/common.c
index 4256af9..3c48faa 100644
--- a/common.c
+++ b/common.c
@@ -314,7 +314,7 @@ log_annoying ("handle_tunnel_input: tunnel_read() = %d\n", n);
 
       /* If fd == 0, then we are using --stdin-stdout so write to stdout,
        * not fd. */
-      m = write_all (fd ? fd : 0, buf, (size_t)n);
+      m = write_all (fd ? fd : 1, buf, (size_t)n);
       log_annoying ("write_all (%d, %p, %d) = %d", fd ? fd : 1, buf, n, m);
       return m;
     }
