mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 15:08:31 +00:00
Add trailing path separator to SDL_GetUserFolder()
This commit is contained in:
@@ -97,7 +97,18 @@ char *SDL_GetUserFolder(SDL_Folder folder)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return SDL_strdup(home);
|
||||
char *retval = SDL_malloc(SDL_strlen(home) + 2);
|
||||
if (!retval) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (SDL_snprintf(retval, SDL_strlen(home) + 2, "%s/", home) < 0) {
|
||||
SDL_SetError("Couldn't snprintf home path for Emscripten: %s", home);
|
||||
SDL_free(retval);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif /* SDL_FILESYSTEM_EMSCRIPTEN */
|
||||
|
Reference in New Issue
Block a user