Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BinBashBanana committed Jan 20, 2025
1 parent 6c02839 commit b48bfbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ retroarch.js
retroarch.js.mem
*.bc
*.wasm
*.wasm.map
obj-emscripten/

# only ignore .js files in the repo root
/*.js
Expand Down
8 changes: 5 additions & 3 deletions cheat_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ void cheat_manager_apply_cheats(void)
void cheat_manager_set_code(unsigned i, const char *str)
{
cheat_manager_t *cheat_st = &cheat_manager_state;
if (!cheat_st->cheats)
if (!cheat_st->cheats || string_is_empty(str))
return;

if (!string_is_empty(str))
cheat_st->cheats[i].code = strdup(str);
if (cheat_st->cheats[i].code)
free(cheat_st->cheats[i].code);

cheat_st->cheats[i].code = strdup(str);

cheat_st->cheats[i].state = true;
}
Expand Down

0 comments on commit b48bfbe

Please sign in to comment.