From 191830dadd6e8528e3a62c9c2e2e22e72dd30248 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 17 Oct 2019 15:45:19 +0000 Subject: [PATCH] country: Fix comparison function 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 --- src/database.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database.c b/src/database.c index d19bf7c..862fe75 100644 --- a/src/database.c +++ b/src/database.c @@ -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; -- 2.39.2