From b5ea10611c1f474095017b20d119e87b61933b48 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 9 Oct 2001 06:56:43 +0000 Subject: [PATCH] avoid-losing-when-sorting-server-prefs-if-a-server-has-left-out-from-under-us-while-we-were-playing-20011009 but it would be better to figure out how we're losing a server out from under us. --- src/afs/afs_server.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index f60691c49..21a8898ef 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -801,10 +801,13 @@ void afs_SortServers(struct server *aservers[], int count) for (i=0; iaddr->sa_iprank < aservers[low]->addr->sa_iprank) { - low = j; - } + if ((!aservers[j]) || (!aservers[j]->addr)) + break; + if ((!aservers[low]) || (!aservers[low]->addr)) + break; + if (aservers[j]->addr->sa_iprank < aservers[low]->addr->sa_iprank) { + low = j; + } } if (low != i) { ts = aservers[i]; -- 2.39.5