removed non-so-stupid gotos from core-misc

in the name of Satan, please do not cause any problems
This commit is contained in:
Václav Šmejkal 2024-02-19 12:26:53 +01:00
parent b6bace31e2
commit 2408e0cef5
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -203,10 +203,8 @@ enum WHY2_EXIT_CODES why2_check_version(void) //! CRASHES WHEN CALLED FROM CHAT
why2_clean_memory("core_version_check"); why2_clean_memory("core_version_check");
return WHY2_WHY2_UPDATE_FAILED; return WHY2_WHY2_UPDATE_FAILED;
} }
} else
goto deallocation; //GREAT SUCCESS! {
}
//COUNT WHY2_VERSIONS BEHIND //COUNT WHY2_VERSIONS BEHIND
int versionsIndex = -1; int versionsIndex = -1;
int versionsBuffer = 0; int versionsBuffer = 0;
@ -230,10 +228,8 @@ enum WHY2_EXIT_CODES why2_check_version(void) //! CRASHES WHEN CALLED FROM CHAT
if (versionsIndex == -1) if (versionsIndex == -1)
{ {
if (!why2_get_flags().no_output) printf("Version %s not found! Check your flags.\n\n", WHY2_VERSION); if (!why2_get_flags().no_output) printf("Version %s not found! Check your flags.\n\n", WHY2_VERSION);
} else
goto deallocation; {
}
//COUNT versionsBuffer //COUNT versionsBuffer
versionsBuffer = json_object_array_length(deprecated) - versionsIndex; versionsBuffer = json_object_array_length(deprecated) - versionsIndex;
@ -242,8 +238,8 @@ enum WHY2_EXIT_CODES why2_check_version(void) //! CRASHES WHEN CALLED FROM CHAT
//WAIT FOR 5 SECONDS //WAIT FOR 5 SECONDS
sleep(5); sleep(5);
} }
}
deallocation: }
//DEALLOCATION //DEALLOCATION
json_object_put(parsedJson); //THIS FREES EVERY json_object - AT LEAST JSON-C'S DOCUMENTATION SAYS THAT json_object_put(parsedJson); //THIS FREES EVERY json_object - AT LEAST JSON-C'S DOCUMENTATION SAYS THAT