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
psxbios: more careful cnf parsing
[pcsx_rearmed.git]
/
libpcsxcore
/
misc.c
diff --git
a/libpcsxcore/misc.c
b/libpcsxcore/misc.c
index
50caad4
..
d748ac0
100644
(file)
--- a/
libpcsxcore/misc.c
+++ b/
libpcsxcore/misc.c
@@
-22,6
+22,7
@@
*/
#include <stddef.h>
*/
#include <stddef.h>
+#include <errno.h>
#include <assert.h>
#include "misc.h"
#include "cdrom.h"
#include <assert.h>
#include "misc.h"
#include "cdrom.h"
@@
-174,8
+175,13
@@
static void getFromCnf(char *buf, const char *key, u32 *val)
buf = strstr(buf, key);
if (buf)
buf = strchr(buf, '=');
buf = strstr(buf, key);
if (buf)
buf = strchr(buf, '=');
- if (buf)
- *val = strtol(buf + 1, NULL, 16);
+ if (buf) {
+ unsigned long v;
+ errno = 0;
+ v = strtoul(buf + 1, NULL, 16);
+ if (errno == 0)
+ *val = v;
+ }
}
int LoadCdrom() {
}
int LoadCdrom() {
@@
-690,6
+696,7
@@
int SaveState(const char *file) {
psxRcntFreeze(f, 1);
mdecFreeze(f, 1);
new_dyna_freeze(f, 1);
psxRcntFreeze(f, 1);
mdecFreeze(f, 1);
new_dyna_freeze(f, 1);
+ padFreeze(f, 1);
result = 0;
cleanup:
result = 0;
cleanup:
@@
-760,6
+767,7
@@
int LoadState(const char *file) {
psxRcntFreeze(f, 0);
mdecFreeze(f, 0);
new_dyna_freeze(f, 0);
psxRcntFreeze(f, 0);
mdecFreeze(f, 0);
new_dyna_freeze(f, 0);
+ padFreeze(f, 0);
if (Config.HLE)
psxBiosCheckExe(biosBranchCheckOld, 0x60);
if (Config.HLE)
psxBiosCheckExe(biosBranchCheckOld, 0x60);