mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-14 02:54:16 -04:00
[GUI] Avoid overflow in alphanum sorting
This commit is contained in:
@ -72,9 +72,15 @@ namespace AssetStudioGUI
|
||||
|
||||
if (char.IsDigit(space1[0]) && char.IsDigit(space2[0]))
|
||||
{
|
||||
int thisNumericChunk = int.Parse(space1);
|
||||
int thatNumericChunk = int.Parse(space2);
|
||||
result = thisNumericChunk.CompareTo(thatNumericChunk);
|
||||
if (long.TryParse(space1, out long thisNumericChunk) &&
|
||||
long.TryParse(space2, out long thatNumericChunk))
|
||||
{
|
||||
result = thisNumericChunk.CompareTo(thatNumericChunk);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = MemoryExtensions.CompareTo(space1, space2, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user