Fix some build scripts and fix warnings

This commit is contained in:
Isaac Shoebottom 2023-09-16 02:00:05 -03:00
parent 07116018ec
commit f45418cdd9
6 changed files with 11 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Assignment1" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Assignment1" TARGET_NAME="Assignment1" CONFIG_NAME="Debug-WSL" RUN_TARGET_PROJECT_NAME="Assignment1" RUN_TARGET_NAME="Assignment1"> <configuration default="false" name="Assignment1" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Assignment1" TARGET_NAME="Assignment1" CONFIG_NAME="RelWithDebInfo-WSL" RUN_TARGET_PROJECT_NAME="Assignment1" RUN_TARGET_NAME="Assignment1">
<method v="2"> <method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method> </method>

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="For Testing" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="true" REDIRECT_INPUT_PATH="$PROJECT_DIR$/tests/exit.txt" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Assignment1" TARGET_NAME="Assignment1" CONFIG_NAME="Debug-WSL" RUN_TARGET_PROJECT_NAME="Assignment1" RUN_TARGET_NAME="Assignment1"> <configuration default="false" name="For Testing" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="true" REDIRECT_INPUT_PATH="$PROJECT_DIR$/tests/exit.txt" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Assignment1" TARGET_NAME="Assignment1" CONFIG_NAME="RelWithDebInfo-WSL" RUN_TARGET_PROJECT_NAME="Assignment1" RUN_TARGET_NAME="Assignment1">
<method v="2"> <method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method> </method>

View File

@ -13,7 +13,7 @@
<option name="EXECUTE_SCRIPT_FILE" value="false" /> <option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs /> <envs />
<method v="2"> <method v="2">
<option name="RunConfigurationTask" enabled="false" run_configuration_name="Assignment1 For Test" run_configuration_type="CMakeRunConfiguration" run_configuration_target="CMakeBuildProfile:Debug-WSL" /> <option name="RunConfigurationTask" enabled="false" run_configuration_name="For Testing" run_configuration_type="CMakeRunConfiguration" run_configuration_target="CMakeBuildProfile:RelWithDebInfo-WSL" />
</method> </method>
</configuration> </configuration>
</component> </component>

View File

@ -16,7 +16,12 @@ int main() {
bool stopLoop = false; bool stopLoop = false;
while (!stopLoop) { while (!stopLoop) {
fgets(buffer, MAX_LEN * 2, stdin); char *result = fgets(buffer, MAX_LEN * 2, stdin);
if (result == NULL) {
// If we get null, there has been an error reading from stdin
fprintf(stderr, "Error reading from stdin\n");
return EXIT_FAILURE;
}
buffer[strcspn(buffer, "\r\n")] = 0; buffer[strcspn(buffer, "\r\n")] = 0;
if (buffer[0] == 'a') { if (buffer[0] == 'a') {
buffer[MAX_LEN - 1] = '\0'; // Prevent buffer overflow buffer[MAX_LEN - 1] = '\0'; // Prevent buffer overflow

View File

@ -1,3 +1,3 @@
ssh ishoebot@remotelabm35.cs.unb.ca "cd ~/build/; rm -rf $($args[0]); mkdir $($args[0])" ssh ishoebot@remotelabm35.cs.unb.ca "cd ~/build/; rm -rf $($args[0])/; mkdir $($args[0])"
scp -r $(Get-Location) ishoebot@remotelabm35.cs.unb.ca:~/build/ scp -r $(Get-Location) ishoebot@remotelabm35.cs.unb.ca:~/build/
ssh ishoebot@remotelabm35.cs.unb.ca "cd ~/build/$($args[0])/; rm -rf build/; chmod +x ./tests/build.sh; ./tests/build.sh $($args[0])" ssh ishoebot@remotelabm35.cs.unb.ca "cd ~/build/$($args[0])/; rm -rf build/; chmod +x ./tests/build.sh; ./tests/build.sh $($args[0])"

View File

@ -1,5 +1,5 @@
cd ~/build/"$1"/ || exit cd ~/build/"$1"/ || exit
mkdir build mkdir build
cd build || exit cd build || exit
cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" ../ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "CodeBlocks - Unix Makefiles" ../
make make