X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/8154b6022bd42b4aba03fc9adcbabd4f588b6575..d9e0300f903aa7cfb85a94480ad544082a7a6c35:/mac/mac.c diff --git a/mac/mac.c b/mac/mac.c index 9e1d1f30..25362061 100644 --- a/mac/mac.c +++ b/mac/mac.c @@ -210,13 +210,10 @@ static void mac_startup(void) { default_protocol = be_default_protocol; /* Find the appropriate default port. */ { - int i; + Backend *b = backend_from_proto(default_protocol); default_port = 0; /* illegal */ - for (i = 0; backends[i].backend != NULL; i++) - if (backends[i].protocol == default_protocol) { - default_port = backends[i].backend->default_port; - break; - } + if (b) + default_port = b->default_port; } flags = FLAG_INTERACTIVE;