X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/e8e8d6e2aaec02b9687ca8f2029bb6473acb0ec7..cae0c0233cb7c0180bfb7a5bca934b6e57805471:/window.c diff --git a/window.c b/window.c index aa6b6809..ddd7aa92 100644 --- a/window.c +++ b/window.c @@ -430,6 +430,21 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) * Trim a colon suffix off the hostname if it's there. */ cfg.host[strcspn(cfg.host, ":")] = '\0'; + + /* + * Remove any remaining whitespace from the hostname. + */ + { + int p1 = 0, p2 = 0; + while (cfg.host[p2] != '\0') { + if (cfg.host[p2] != ' ' && cfg.host[p2] != '\t') { + cfg.host[p1] = cfg.host[p2]; + p1++; + } + p2++; + } + cfg.host[p1] = '\0'; + } } /*