From 2c6a5df89dfba9a54f3bb09d145ef13081c76bf1 Mon Sep 17 00:00:00 2001 From: gameblabla Date: Thu, 18 Jul 2019 02:28:55 +0200 Subject: [PATCH] psxbios: Add checks for strlen. Per what Nocash documentation says. --- libpcsxcore/psxbios.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.39.5