X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/8df7a775f6f8b0f81f84eafe28cd0bb8d4c6d1f4..edce8e45a5bb31bb141734e616de6b4d93202963:/plink.c diff --git a/plink.c b/plink.c index f5f6c8a0..16a44b38 100644 --- a/plink.c +++ b/plink.c @@ -7,6 +7,7 @@ #endif #include #include +#include #include #define PUTTY_DO_GLOBALS /* actually _define_ globals */ @@ -16,7 +17,7 @@ void fatalbox (char *p, ...) { va_list ap; - fprintf(stderr, "FATAL ERROR: ", p); + fprintf(stderr, "FATAL ERROR: "); va_start(ap, p); vfprintf(stderr, p, ap); va_end(ap); @@ -26,7 +27,7 @@ void fatalbox (char *p, ...) { } void connection_fatal (char *p, ...) { va_list ap; - fprintf(stderr, "FATAL ERROR: ", p); + fprintf(stderr, "FATAL ERROR: "); va_start(ap, p); vfprintf(stderr, p, ap); va_end(ap); @@ -370,13 +371,15 @@ int main(int argc, char **argv) { /* * One string. */ - do_defaults (p, &cfg); - if (cfg.host[0] == '\0') { + Config cfg2; + do_defaults (p, &cfg2); + if (cfg2.host[0] == '\0') { /* No settings for this host; use defaults */ strncpy(cfg.host, p, sizeof(cfg.host)-1); cfg.host[sizeof(cfg.host)-1] = '\0'; cfg.port = 22; - } + } else + cfg = cfg2; } else { *r++ = '\0'; strncpy(cfg.username, p, sizeof(cfg.username)-1); @@ -555,6 +558,8 @@ int main(int argc, char **argv) { socket = sklist[i]; wp = (WPARAM)socket; if (!WSAEnumNetworkEvents(socket, netevent, &things)) { + noise_ultralight(socket); + noise_ultralight(things.lNetworkEvents); if (things.lNetworkEvents & FD_READ) connopen &= select_result(wp, (LPARAM)FD_READ); if (things.lNetworkEvents & FD_CLOSE) @@ -566,6 +571,7 @@ int main(int argc, char **argv) { } } } else if (n == 1) { + noise_ultralight(idata.len); if (idata.len > 0) { back->send(idata.buffer, idata.len); } else {