From 7ac03aeccbf2a7b778eb1d4f960efe1cd575551a Mon Sep 17 00:00:00 2001 From: diamant3 Date: Sun, 16 Oct 2022 23:58:42 +0800 Subject: [PATCH] fix restrict warning --- src/debug/pspdebugkb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/debug/pspdebugkb.c b/src/debug/pspdebugkb.c index 737b3ea9..dc0cd7e4 100644 --- a/src/debug/pspdebugkb.c +++ b/src/debug/pspdebugkb.c @@ -251,8 +251,8 @@ void pspDebugKbInit(char* str) { break; case 1: // Space if (strlen(str) < PSP_DEBUG_KB_MAXLEN) { - char out[PSP_DEBUG_KB_MAXLEN] = {0}; - snprintf(out, strlen(str), "%s ", str); + char out[PSP_DEBUG_KB_MAXLEN + 2]; + snprintf(out, sizeof(out), "%s ", str); pspDebugKbDrawString(out); } break; @@ -273,8 +273,8 @@ void pspDebugKbInit(char* str) { }; } else { if (strlen(str) < PSP_DEBUG_KB_MAXLEN) { - char out[PSP_DEBUG_KB_MAXLEN] = {0}; - snprintf(out, strlen(str), "%s%c", str, charTable[row][col]); + char out[PSP_DEBUG_KB_MAXLEN + 2]; + snprintf(out, sizeof(out), "%s%c", str, charTable[row][col]); pspDebugKbDrawString(out); } }