summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fios.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fios.cpp b/src/fios.cpp
index 8c68a9e62..ab85a8511 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -49,14 +49,14 @@ int CDECL compare_FiosItems(const void *a, const void *b)
{
const FiosItem *da = (const FiosItem *)a;
const FiosItem *db = (const FiosItem *)b;
- int r;
+ int r = 0;
- if (_savegame_sort_order & SORT_BY_NAME) {
- r = strcasecmp(da->title, db->title);
- } else {
+ if ((_savegame_sort_order & SORT_BY_NAME) == 0) {
r = da->mtime < db->mtime ? -1 : 1;
}
+ if (r == 0) r = strcasecmp(da->title, db->title);
+
if (_savegame_sort_order & SORT_DESCENDING) r = -r;
return r;
}