Skip to content

Commit

Permalink
don't try to sort 18446744073709551615 entries if non exist
Browse files Browse the repository at this point in the history
  • Loading branch information
HookedBehemoth committed Mar 10, 2021
1 parent 181150b commit ffc8da5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions common/hekate.cpp
Expand Up @@ -119,14 +119,16 @@ namespace Hekate {
break;
}

/* Reorder ini files by ASCII ordering. */
char temp[0x100];
for (size_t i = 0; i < count - 1 ; i++) {
for (size_t j = i + 1; j < count; j++) {
if (std::strcmp(dir_entries[i], dir_entries[j]) > 0) {
std::strcpy(temp, dir_entries[i]);
std::strcpy(dir_entries[i], dir_entries[j]);
std::strcpy(dir_entries[j], temp);
if (count > 1) {
/* Reorder ini files by ASCII ordering. */
char temp[0x100];
for (size_t i = 0; i < count - 1 ; i++) {
for (size_t j = i + 1; j < count; j++) {
if (std::strcmp(dir_entries[i], dir_entries[j]) > 0) {
std::strcpy(temp, dir_entries[i]);
std::strcpy(dir_entries[i], dir_entries[j]);
std::strcpy(dir_entries[j], temp);
}
}
}
}
Expand Down

0 comments on commit ffc8da5

Please sign in to comment.