Merge branch 'bess' into gbs

This commit is contained in:
Lior Halphon 2021-04-10 16:12:35 +03:00
commit 955ef59140
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ void GB_remove_cheat(GB_gameboy_t *gb, const GB_cheat_t *cheat)
GB_cheat_hash_t **hash = &gb->cheat_hash[hash_addr(cheat->address)];
for (unsigned i = 0; i < (*hash)->size; i++) {
if ((*hash)->cheats[i] == cheat) {
(*hash)->cheats[i] = (*hash)->cheats[(*hash)->size--];
(*hash)->cheats[i] = (*hash)->cheats[--(*hash)->size];
if ((*hash)->size == 0) {
free(*hash);
*hash = NULL;