fixed some segfault

This commit is contained in:
Marc
2022-09-11 14:20:29 +02:00
parent 2d63fd8d92
commit 15b8fdad98
2 changed files with 11 additions and 4 deletions
+10 -3
View File
@@ -364,9 +364,15 @@ int main(int argc, char ** argv) {
return EXIT_FAILURE;
}
gamePaths = search_games();
int searchStatus;
gamePaths = search_games(&searchStatus);
int returnValue = EXIT_SUCCESS;
if(searchStatus == EXIT_FAILURE) {
printf("Error while looking up libraries, do you have steam installed ?");
goto exit;
}
char * configFolder = g_build_filename(getHome(), MANAGER_FILES, NULL);
if(access(configFolder, F_OK) != 0) {
@@ -377,7 +383,7 @@ int main(int argc, char ** argv) {
if(getuid() == 0) {
printf("For the first please run without sudo\n");
returnValue = EXIT_FAILURE;
goto exit;
goto exit2;
} else {
//leading 0 == octal
int i = g_mkdir_with_parents(configFolder, 0755);
@@ -445,7 +451,8 @@ int main(int argc, char ** argv) {
returnValue = EXIT_FAILURE;
}
exit:
exit2:
free(configFolder);
exit:
return returnValue;
}
+1 -1
View File
@@ -43,7 +43,7 @@ const static char * GAMES_NAMES[] = {
"Skyrim Special Edition",
};
GHashTable * search_games();
GHashTable* search_games(int * status);
int getGameIdFromAppId(u_int32_t id);
#endif