diff options
author | gameblabla | 2019-07-18 01:09:21 +0200 |
---|---|---|
committer | gameblabla | 2019-07-18 01:09:21 +0200 |
commit | bee52312d06313957cfe73dacdb1717d1c8bcddb (patch) | |
tree | bccfbcc1eff129cc43c0e5d7013dc7a1fb9b964e /libpcsxcore/psxbios.c | |
parent | bebe989ba22f0bac230a0b8a75617ae895ea274f (diff) | |
download | pcsx_rearmed-bee52312d06313957cfe73dacdb1717d1c8bcddb.tar.gz pcsx_rearmed-bee52312d06313957cfe73dacdb1717d1c8bcddb.tar.bz2 pcsx_rearmed-bee52312d06313957cfe73dacdb1717d1c8bcddb.zip |
psxbios: Add checks to strcat
Nocash documentation says that function fails if src or dst is 0.
If so, then it must return 0.
This fix is required for fixing crash on bootup in Digimon World.
Diffstat (limited to 'libpcsxcore/psxbios.c')
-rw-r--r-- | libpcsxcore/psxbios.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 292d80d..4624bf4 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -394,7 +394,12 @@ void psxBios_strcat() { // 0x15 #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s: %s, %s\n", biosA0n[0x15], Ra0, Ra1); #endif - + if (a0 == 0 || a1 == 0) + { + v0 = 0; + pc0 = ra; + return; + } while (*p1++); --p1; while ((*p1++ = *p2++) != '\0'); |