Fix LocaleRosterData::CompareInfos.

* The given void pointers are pointers to the actual list items, which
  are pointers themselves, so there was an indirection missing
* Fix inverted sort order

This could have caused spurious crashes related to initialization of
the locale kit, most notably this was responsible for triggering a
crashing bug in the plaintext add-on that caused the x86 image
not being able to boot.
I will continue with trying to find the actual crash, too.
This commit is contained in:
Oliver Tappe 2014-08-14 17:01:28 +02:00
parent 8cb3428017
commit 735ec4d986

View File

@ -165,8 +165,12 @@ LocaleRosterData::Refresh()
int
LocaleRosterData::CompareInfos(const void* left, const void* right)
{
return ((CatalogAddOnInfo*)right)->fPriority
- ((CatalogAddOnInfo*)left)->fPriority;
const CatalogAddOnInfo* leftInfo
= * static_cast<const CatalogAddOnInfo* const *>(left);
const CatalogAddOnInfo* rightInfo
= * static_cast<const CatalogAddOnInfo* const *>(right);
return leftInfo->fPriority - rightInfo->fPriority;
}