Make power sort countries of equal power predictably

How qsort() sorts members that compare equal is unspecified.  Can
upset the smoke test.  Observed under FreeBSD 8.3.

Break ties in power by comparing country numbers.  Countries equal in
power are now sorted by increasing country number.
This commit is contained in:
Markus Armbruster 2013-04-06 09:46:51 +02:00
parent c798863bd7
commit 335dd1b974

View file

@ -337,7 +337,7 @@ powcmp(const void *a, const void *b)
return -1;
if (p1->p_power < p2->p_power)
return 1;
return 0;
return p1->p_nation - p2->p_nation;
}
static void