notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spu: avoid relying on signed overflow undefined behavior
[pcsx_rearmed.git]
/
libpcsxcore
/
cheat.c
diff --git
a/libpcsxcore/cheat.c
b/libpcsxcore/cheat.c
index
a016aee
..
e0cf411
100644
(file)
--- a/
libpcsxcore/cheat.c
+++ b/
libpcsxcore/cheat.c
@@
-19,6
+19,7
@@
#include "psxcommon.h"
#include "r3000a.h"
#include "psxmem.h"
#include "psxcommon.h"
#include "r3000a.h"
#include "psxmem.h"
+#include "misc.h"
#include "cheat.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;
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;
}
return -1;
}
+ Cheats[NumCheats].Descr = strdup(descr[0] ? descr : _("(Untitled)"));
NumCheats++;
return 0;
}
NumCheats++;
return 0;
}
@@
-400,6
+401,7
@@
void RemoveCheat(int index) {
assert(index >= 0 && index < NumCheats);
free(Cheats[index].Descr);
assert(index >= 0 && index < NumCheats);
free(Cheats[index].Descr);
+ Cheats[index].Descr = NULL;
while (index < NumCheats - 1) {
Cheats[index] = Cheats[index + 1];
while (index < NumCheats - 1) {
Cheats[index] = Cheats[index + 1];