Prevent network errors from summarily closing the window when CoE is off
[u/mdw/putty] / scp.c
diff --git a/scp.c b/scp.c
index 1160139..0b2a26c 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -157,6 +157,19 @@ void fatalbox(char *fmt, ...)
 
     exit(1);
 }
+void connection_fatal(char *fmt, ...)
+{
+    char str[0x100]; /* Make the size big enough */
+    va_list ap;
+    va_start(ap, fmt);
+    strcpy(str, "Fatal:");
+    vsprintf(str+strlen(str), fmt, ap);
+    va_end(ap);
+    strcat(str, "\n");
+    tell_str(stderr, str);
+
+    exit(1);
+}
 
 /*
  *  Print an error message and exit after closing the SSH link.