From 65415dfc55fd6ffe6bc4ca613c47e9df022aa716 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 14 Feb 2021 13:03:37 +0200 Subject: [PATCH] Fixed infinite loop crash from string comparison --- nel/src/gui/dbgroup_combo_box.cpp | 2 +- ryzom/client/src/interface_v3/people_list.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nel/src/gui/dbgroup_combo_box.cpp b/nel/src/gui/dbgroup_combo_box.cpp index b54d33e8f..9adffab86 100644 --- a/nel/src/gui/dbgroup_combo_box.cpp +++ b/nel/src/gui/dbgroup_combo_box.cpp @@ -46,7 +46,7 @@ namespace NLGUI static inline bool lt_text(const std::pair &s1, const std::pair &s2) { // return toLower(s1.second) < toLower(s2.second); - return -NLMISC::compareCaseInsensitive(s1.second, s2.second); + return NLMISC::compareCaseInsensitive(s1.second, s2.second) < 0; } std::string CDBGroupComboBox::measureMenu; diff --git a/ryzom/client/src/interface_v3/people_list.cpp b/ryzom/client/src/interface_v3/people_list.cpp index d99089a69..246f3bc0a 100644 --- a/ryzom/client/src/interface_v3/people_list.cpp +++ b/ryzom/client/src/interface_v3/people_list.cpp @@ -195,7 +195,7 @@ bool CPeopleList::sortExByContactId(const CPeople& a, const CPeople& b) //================================================================== bool CPeopleList::sortExByName(const CPeople& a, const CPeople& b) { - return -NLMISC::compareCaseInsensitive(a.getName(), b.getName()); // FIXME: Locale-dependent sort + return NLMISC::compareCaseInsensitive(a.getName(), b.getName()) < 0; // FIXME: Locale-dependent sort } //================================================================== @@ -204,7 +204,7 @@ bool CPeopleList::sortExByOnline(const CPeople& a, const CPeople& b) // We want order: online/alpha, offworld/alpha, offline/alpha if (a.Online == b.Online) { - return -NLMISC::compareCaseInsensitive(a.getName(), b.getName()); // FIXME: Locale-dependent sort + return NLMISC::compareCaseInsensitive(a.getName(), b.getName()) < 0; // FIXME: Locale-dependent sort } else {