Prevent network errors from summarily closing the window when CoE is off
[u/mdw/putty] / plink.c
diff --git a/plink.c b/plink.c
index 70aab6d..fd9d36d 100644 (file)
--- a/plink.c
+++ b/plink.c
@@ -20,6 +20,16 @@ void fatalbox (char *p, ...) {
     WSACleanup();
     exit(1);
 }
+void connection_fatal (char *p, ...) {
+    va_list ap;
+    fprintf(stderr, "FATAL ERROR: ", p);
+    va_start(ap, p);
+    vfprintf(stderr, p, ap);
+    va_end(ap);
+    fputc('\n', stderr);
+    WSACleanup();
+    exit(1);
+}
 
 HANDLE outhandle;