Skip to content

Commit

Permalink
filesystem: Fixed compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 1, 2024
1 parent f10a1db commit 66e11b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/filesystem/SDL_filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static char *AssembleNativeFsPath(SDL_FSops *fs, const char *path)
const char *base = (const char *) fs->opaque;
const size_t baselen = base ? SDL_strlen(base) : 0;
const size_t pathlen = path ? SDL_strlen(path) : 0;
SDL_bool isstack;
SDL_bool isstack = SDL_FALSE;
char *sanitized = path ? SDL_small_alloc(char, pathlen + 1, &isstack) : NULL;
if (path) {
if (!sanitized) {
Expand All @@ -286,7 +286,9 @@ static char *AssembleNativeFsPath(SDL_FSops *fs, const char *path)
const size_t slen = SDL_snprintf(fullpath, fullpathlen, "%s%s%s", base ? base : "", base ? PLATFORM_PATH_SEPARATOR : PLATFORM_ROOT_PATH, sanitized ? sanitized : "");
SDL_assert(slen < fullpathlen);

SDL_small_free(sanitized, isstack);
if (sanitized) {
SDL_small_free(sanitized, isstack);
}

return fullpath;
}
Expand Down

0 comments on commit 66e11b2

Please sign in to comment.