notaz.gp2x.de
/
pcsx_rearmed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c980be0
)
psxbios: more careful cnf parsing
author
notaz
<notasas@gmail.com>
Sat, 30 Sep 2023 19:43:03 +0000
(22:43 +0300)
committer
notaz
<notasas@gmail.com>
Sat, 30 Sep 2023 19:45:01 +0000
(22:45 +0300)
libpcsxcore/misc.c
patch
|
blob
|
blame
|
history
diff --git
a/libpcsxcore/misc.c
b/libpcsxcore/misc.c
index
da1dbea
..
d748ac0
100644
(file)
--- a/
libpcsxcore/misc.c
+++ b/
libpcsxcore/misc.c
@@
-22,6
+22,7
@@
*/
#include <stddef.h>
+#include <errno.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, '=');
- 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() {