SDL: Add slash to cwd call (4d82c)

From 4d82ceae0c45f315797e4f5b07b0190e39435b8c Mon Sep 17 00:00:00 2001
From: Francisco Javier Trujillo Mata <[EMAIL REDACTED]>
Date: Wed, 26 Jun 2024 22:20:37 +0200
Subject: [PATCH] Add slash to cwd call

---
 src/filesystem/ps2/SDL_sysfilesystem.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/filesystem/ps2/SDL_sysfilesystem.c b/src/filesystem/ps2/SDL_sysfilesystem.c
index 6b6446656cebf..6d5480f96261e 100644
--- a/src/filesystem/ps2/SDL_sysfilesystem.c
+++ b/src/filesystem/ps2/SDL_sysfilesystem.c
@@ -33,16 +33,14 @@
 
 char *SDL_GetBasePath(void)
 {
-    char *retval;
+    char *retval = NULL;
     size_t len;
     char cwd[FILENAME_MAX];
 
     getcwd(cwd, sizeof(cwd));
-    len = SDL_strlen(cwd) + 1;
+    len = SDL_strlen(cwd) + 2;
     retval = (char *)SDL_malloc(len);
-    if (retval) {
-        SDL_memcpy(retval, cwd, len);
-    }
+    SDL_snprintf(retval, len, "%s/", cwd);
 
     return retval;
 }