suggestions

This commit is contained in:
Kylie C 2025-08-14 00:04:20 -04:00
parent b81d67cf7f
commit fc2fee33ab
4 changed files with 10 additions and 8 deletions

View File

@ -113,6 +113,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- name: Get CMake (Android)
if: ${{ matrix.android }}
uses: lukka/get-cmake@latest

View File

@ -10,9 +10,10 @@ void Android_SetupDefaultConfigOverrides(dictionary* p_dictionary)
SDL_Log("Overriding default config for Android");
const char* data = SDL_GetAndroidExternalStoragePath();
char* savedata = new char[strlen(data) + strlen("/saves/") + 1];
strcpy(savedata, data);
strcat(savedata, "/saves/");
size_t len = SDL_strlen(data) + SDL_strlen("/saves/") + 1;
char* savedata = new char[len];
SDL_strlcpy(savedata, data, len);
SDL_strlcat(savedata, "/saves/", len);
if (!SDL_GetPathInfo(savedata, NULL)) {
SDL_CreateDirectory(savedata);

View File

@ -1,4 +1,3 @@
#ifndef ANDROID_CONFIG_H
#define ANDROID_CONFIG_H

View File

@ -1034,9 +1034,10 @@ bool IsleApp::LoadConfig()
#elif defined(ANDROID)
// SDL_GetAndroidExternalStoragePath() returns without a trailing / resulting in "filesisle.ini" :(
const char* androidPath = SDL_GetAndroidExternalStoragePath();
char* prefPath = new char[strlen(androidPath) + 2];
strcpy(prefPath, androidPath);
strcat(prefPath, "/");
size_t len = SDL_strlen(androidPath) + 2;
char* prefPath = new char[len];
SDL_strlcpy(prefPath, androidPath, len);
SDL_strlcat(prefPath, "/", len);
#else
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
#endif
@ -1242,7 +1243,7 @@ bool IsleApp::LoadConfig()
iniparser_freedict(dict);
delete[] iniConfig;
#if !defined(IOS) && !defined(ANDROID)
#ifndef IOS
SDL_free(prefPath);
#endif