X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcheat.c;h=e0cf411e081b6a5c0cf54299ffbd0b42830df271;hb=b560436b844ccc088f7e72aff7e246b0d285744c;hp=a016aeec8820e7533da6a1f1377b87784f018440;hpb=2c843d964027089a747453afc0b07d0eac5835d9;p=pcsx_rearmed.git diff --git a/libpcsxcore/cheat.c b/libpcsxcore/cheat.c index a016aeec..e0cf411e 100644 --- a/libpcsxcore/cheat.c +++ b/libpcsxcore/cheat.c @@ -19,6 +19,7 @@ #include "psxcommon.h" #include "r3000a.h" #include "psxmem.h" +#include "misc.h" #include "cheat.h" @@ -340,7 +341,6 @@ int AddCheat(const char *descr, char *code) { } } - Cheats[NumCheats].Descr = strdup(descr[0] ? descr : _("(Untitled)")); Cheats[NumCheats].Enabled = 0; Cheats[NumCheats].WasEnabled = 0; Cheats[NumCheats].First = NumCodes; @@ -392,6 +392,7 @@ int AddCheat(const char *descr, char *code) { return -1; } + Cheats[NumCheats].Descr = strdup(descr[0] ? descr : _("(Untitled)")); NumCheats++; return 0; } @@ -400,6 +401,7 @@ void RemoveCheat(int index) { assert(index >= 0 && index < NumCheats); free(Cheats[index].Descr); + Cheats[index].Descr = NULL; while (index < NumCheats - 1) { Cheats[index] = Cheats[index + 1];