From f6af5ff13acee20fd9cc636390b10fd790072221 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 15 Nov 2021 18:26:57 +0100 Subject: [PATCH] cellRtcGetDaysInMonth: fix param check --- rpcs3/Emu/Cell/Modules/cellRtc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellRtc.cpp b/rpcs3/Emu/Cell/Modules/cellRtc.cpp index 81a7c2c78a..a893ba557e 100644 --- a/rpcs3/Emu/Cell/Modules/cellRtc.cpp +++ b/rpcs3/Emu/Cell/Modules/cellRtc.cpp @@ -1457,7 +1457,7 @@ error_code cellRtcGetDaysInMonth(s32 year, s32 month) { cellRtc.todo("cellRtcGetDaysInMonth(year=%d, month=%d)", year, month); - if ((year < 0) || (month < 0) || (month > 12)) + if ((year < 0) || (month <= 0) || (month > 12)) { return CELL_RTC_ERROR_INVALID_ARG; } @@ -1467,7 +1467,7 @@ error_code cellRtcGetDaysInMonth(s32 year, s32 month) return not_an_error(DAYS_IN_MONTH[month + 11]); } - return not_an_error(DAYS_IN_MONTH[month + -1]); + return not_an_error(DAYS_IN_MONTH[month - 1]); } error_code cellRtcGetDayOfWeek(s32 year, s32 month, s32 day)