From: gameblabla Date: Thu, 18 Jul 2019 00:28:55 +0000 (+0200) Subject: psxbios: Add checks for strlen. X-Git-Tag: r23~156^2~22 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c6a5df89dfba9a54f3bb09d145ef13081c76bf1;p=pcsx_rearmed.git psxbios: Add checks for strlen. Per what Nocash documentation says. --- diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 13cfe733..cd2fb0c5 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -666,6 +666,11 @@ void psxBios_strncpy() { // 0x1a void psxBios_strlen() { // 0x1b char *p = (char *)Ra0; v0 = 0; + if (a0 == 0) + { + pc0 = ra; + return; + } while (*p++) v0++; pc0 = ra; }