diff --git a/Start_Linux/input.c b/Start_Linux/input.c index 2018efc..ceab0b6 100644 --- a/Start_Linux/input.c +++ b/Start_Linux/input.c @@ -13,7 +13,8 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) char buffer[MAX_WORD_LEN]; unsigned int count = 0; - if (file == NULL) { + if (file == NULL) + { return 1; } @@ -24,7 +25,8 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) while (token != NULL && count < maxWordCount) { // In Großbuchstaben umwandeln - for (int i = 0; token[i] != '\0'; i++) { + for (int i = 0; token[i] != '\0'; i++) + { token[i] = toupper((unsigned char)token[i]); } @@ -39,7 +41,5 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) } } - fclose(file); - return count; } diff --git a/Start_Windows/input.c b/Start_Windows/input.c index 2018efc..ceab0b6 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -13,7 +13,8 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) char buffer[MAX_WORD_LEN]; unsigned int count = 0; - if (file == NULL) { + if (file == NULL) + { return 1; } @@ -24,7 +25,8 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) while (token != NULL && count < maxWordCount) { // In Großbuchstaben umwandeln - for (int i = 0; token[i] != '\0'; i++) { + for (int i = 0; token[i] != '\0'; i++) + { token[i] = toupper((unsigned char)token[i]); } @@ -39,7 +41,5 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) } } - fclose(file); - return count; }