From 36c61ff8e7c2c3b3daf67e26fa590fcfe1a44ca6 Mon Sep 17 00:00:00 2001 From: Elena Riedmann Date: Mon, 30 Mar 2026 18:42:57 +0200 Subject: [PATCH] =?UTF-8?q?einfach=20nur=20kosmetische=20=C3=84nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Start_Linux/input.c | 6 +++--- Start_Linux/main.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Start_Linux/input.c b/Start_Linux/input.c index 5e752b3..3b0d136 100644 --- a/Start_Linux/input.c +++ b/Start_Linux/input.c @@ -34,9 +34,9 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) char *word = readWord(file); if(word != NULL) { - strncpy(words[count], word, MAX_WORD_LEN - 1); // Wort in Array kopieren - words[count][MAX_WORD_LEN - 1] = '\0'; // Sicherstellen, dass String nullterminiert ist - free(word); // Dynamisch allokierten Speicher freigeben + strncpy(words[count], word, MAX_WORD_LEN - 1); // Wort in Array kopieren + words[count][MAX_WORD_LEN - 1] = '\0'; // Sicherstellen, dass String nullterminiert ist + free(word); // Dynamisch allokierten Speicher freigeben count++; } } diff --git a/Start_Linux/main.c b/Start_Linux/main.c index ae5253f..9e014b8 100644 --- a/Start_Linux/main.c +++ b/Start_Linux/main.c @@ -31,10 +31,13 @@ int main(int argc, char *argv[]) // Read words from file and store in 'words' array wordCount = readWords(file, words, MAX_NUMBER_OF_WORDS); - fclose(file); // TODO: - // Check if all words were successfully placed - // Start the game if successful - // error message if some words couldn't be placed + fclose(file); + + + // TODO: + // Check if all words were successfully placed + // Start the game if successful + // error message if some words couldn't be placed // Create the word salad by placing words into grid @@ -42,7 +45,7 @@ int main(int argc, char *argv[]) if(placedWords==wordCount) { - // Start the graphical game with the created word salad and the list of words + // Spiel starten, mit dem erstellten wordSalad, der Anzahl der Wörter und der Liste der Wörter startGame(wordSalad, SALAD_SIZE, words, wordCount, 800); } else