diff options
author | pommicket <pommicket@gmail.com> | 2023-10-17 12:15:51 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-10-17 12:15:51 -0400 |
commit | 7b7fb826b33773bab0cb57cc0dc234a9d7a0742e (patch) | |
tree | 867d92c5fdb3fca10210a560b47c5f782ac905f3 | |
parent | 7141f05bdc5df4270b0dd68704049eb70bdcc05b (diff) |
stabilize config sort
-rw-r--r-- | ted.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -220,12 +220,14 @@ char *ted_get_root_dir(Ted *ted) { static int applicable_configs_cmp(void *context, const void *av, const void *bv) { const Config *const all_configs = context; - const u32 *ai = av, *bi = bv; - const Config *ac = &all_configs[*ai], *bc = &all_configs[*bi]; + const u32 ai = *(const u32 *)av, bi = *(const u32 *)bv; + const Config *ac = &all_configs[ai], *bc = &all_configs[bi]; const i32 a = config_priority(ac); const i32 b = config_priority(bc); if (a < b) return -1; if (a > b) return 1; + if (ai < bi) return -1; + if (ai > bi) return 1; return 0; } |