remove fclose() because it's already called in main.c
This commit is contained in:
+4
-4
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user