X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=mac%2Fmac.c;h=25362061a210860eb29b1d2ed5601e803b4ee04b;hb=46c00b0f381f48a9992e43e014e104015952e9da;hp=9e1d1f30e2418fbdfd07ffbdc54ba8b127f508b7;hpb=d403e312333cd610cf8e05b82f948117b9f3fd4b;p=PuTTY.git 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;