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