SDL: Add slash to cwd call

From d86ea0622d5e2cf254cb41b6bd534bf9467d97ce 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 d5b2632b2950c..da773eb690330 100644
--- a/src/filesystem/ps2/SDL_sysfilesystem.c
+++ b/src/filesystem/ps2/SDL_sysfilesystem.c
@@ -30,16 +30,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;
 }