diff options
-rw-r--r-- | src/Hill.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Hill.cxx b/src/Hill.cxx index c2971cf..6404ec8 100644 --- a/src/Hill.cxx +++ b/src/Hill.cxx @@ -212,11 +212,17 @@ static int comp_mountains_name(const void *n1, const void *n2) { Hill *m1 = *(Hill **)n1; Hill *m2 = *(Hill **)n2; + int r; - if (m1 && m2) - return strcasecmp(m1->name, m2->name); - else + if (m1 && m2) { + r = strcasecmp(m1->name, m2->name); + if (r == 0) + return (int) (m1->height - m2->height); + else + return r; + } else { return 0; + } } void |