From 5d490f6895303c32fa38fa9a098744c0a69af5c6 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 26 Jul 2015 23:35:23 +0200 Subject: [PATCH] Fix sorting --- zathura/database-plain.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zathura/database-plain.c b/zathura/database-plain.c index 12fc2ed..3f4133d 100644 --- a/zathura/database-plain.c +++ b/zathura/database-plain.c @@ -830,8 +830,8 @@ plain_io_append(GiraraInputHistoryIO* db, const char* input) static int compare_time(const void* l, const void* r, void* data) { - const gchar* lhs = l; - const gchar* rhs = r; + const gchar* lhs = *(const gchar**) l; + const gchar* rhs = *(const gchar**) r; GKeyFile* keyfile = data; time_t lhs_time = 0; @@ -874,8 +874,9 @@ plain_get_recent_files(zathura_database_t* db, int max) } for (gsize s = 0; s != groups_size; ++s) { - girara_list_append(result, groups[s]); + girara_list_append(result, g_strdup(groups[s])); } + g_strfreev(groups); return result; }