country: Fix comparison function
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Oct 2019 15:45:19 +0000 (15:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Oct 2019 15:54:50 +0000 (15:54 +0000)
This return value was incorrect which caused that sorting
countries did not work and therefore could not been found
in the database any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c

index d19bf7c..862fe75 100644 (file)
@@ -664,7 +664,7 @@ LOC_EXPORT int loc_database_get_country(struct loc_database* db,
                // adjust our search pointers
                loc_country_unref(*country);
 
-               if (result < 0) {
+               if (result > 0) {
                        lo = i + 1;
                } else
                        hi = i - 1;