diff --git a/build/test/out/c/quizduell.o b/build/test/out/c/quizduell.o index c8c2f5d..b0c7272 100644 Binary files a/build/test/out/c/quizduell.o and b/build/test/out/c/quizduell.o differ diff --git a/build/test/out/test_quizduell.out b/build/test/out/test_quizduell.out index 8d8ff17..5e3825f 100644 Binary files a/build/test/out/test_quizduell.out and b/build/test/out/test_quizduell.out differ diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index d83a877..b8eee11 100644 --- a/build/test/results/test_casualQuiz.pass +++ b/build/test/results/test_casualQuiz.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.02078239998081699 +:time: 0.022334299981594086 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index 317ba20..aa4b0ee 100644 --- a/build/test/results/test_quizduell.pass +++ b/build/test/results/test_quizduell.pass @@ -51,4 +51,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.021433699992485344 +:time: 0.039953699975740165 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 34a121c..9c3c852 100644 --- a/build/test/results/test_timequiz.pass +++ b/build/test/results/test_timequiz.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.02030239999294281 +:time: 0.02081809999071993 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index f7086df..eb16a2d 100644 --- a/build/test/results/test_wwm.pass +++ b/build/test/results/test_wwm.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.021443899982841685 +:time: 0.019612700009020045 diff --git a/src/quizduell.c b/src/quizduell.c index 9cc7029..cf3aa2c 100644 --- a/src/quizduell.c +++ b/src/quizduell.c @@ -131,6 +131,9 @@ void quizduell() { Kategorie kategorien[MAX_CATEGORIES]; kategorien[0].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage)); + if (kategorien[0].fragen == NULL) { + exit(EXIT_FAILURE); + } kategorien[0].fragen[0] = erstelleFrage("Whats the height of the Zugspitze?", "2482 Meter", "2867 Meter", "2962 Meter", "3173 Meter", 'C'); kategorien[0].fragen[1] = erstelleFrage("In which Federal State is the Zugspitze?", "Bayern", "Baden-Wuerttemberg", "Hessen", "Thueringen", 'A'); kategorien[0].fragen[2] = erstelleFrage("Which Mountain is the highest following after the Zugspitze?", "Grossglockner", "Watzmann", "Feldberg", "Meissner", 'B'); @@ -138,6 +141,9 @@ void quizduell() { kategorien[0].joker = 1; kategorien[1].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage)); + if (kategorien[1].fragen == NULL) { + exit(EXIT_FAILURE); + } kategorien[1].fragen[0] = erstelleFrage("Which Ingredient is used traditionally for Pesto?", "Tomatoes", "Basil", "Spinach", "Oregano", 'B'); kategorien[1].fragen[1] = erstelleFrage("Which meal is known for its usage of rice?", "Lasagna", "Sushi", "Pizza", "Hamburger", 'B'); kategorien[1].fragen[2] = erstelleFrage("Which color has a ripe banana?", "Red", "Green", "Yellow", "Orange", 'C'); @@ -145,6 +151,9 @@ void quizduell() { kategorien[1].joker = 1; kategorien[2].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage)); + if (kategorien[2].fragen == NULL) { + exit(EXIT_FAILURE); + } kategorien[2].fragen[0] = erstelleFrage("In which sport is the term 'home run' used?", "Soccer/Football", "Baseball", "Tennis", "Golf", 'B'); kategorien[2].fragen[1] = erstelleFrage("How many players are there normally on the pitch in a soccer/football team?", "9", "11", "7", "5", 'B'); kategorien[2].fragen[2] = erstelleFrage("What sport is played on a pitch and has a 'wicket'?", "Rugby", "Cricket", "American Football", "Hockey", 'B');