remove fclose() because it's already called in main.c
This commit is contained in:
parent
0aa5c5e9e3
commit
69f9945fe0
@ -13,7 +13,8 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
char buffer[MAX_WORD_LEN];
|
char buffer[MAX_WORD_LEN];
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
|
|
||||||
if (file == NULL) {
|
if (file == NULL)
|
||||||
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +25,8 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
while (token != NULL && count < maxWordCount)
|
while (token != NULL && count < maxWordCount)
|
||||||
{
|
{
|
||||||
// In Großbuchstaben umwandeln
|
// 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]);
|
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;
|
return count;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,8 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
char buffer[MAX_WORD_LEN];
|
char buffer[MAX_WORD_LEN];
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
|
|
||||||
if (file == NULL) {
|
if (file == NULL)
|
||||||
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +25,8 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
while (token != NULL && count < maxWordCount)
|
while (token != NULL && count < maxWordCount)
|
||||||
{
|
{
|
||||||
// In Großbuchstaben umwandeln
|
// 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]);
|
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;
|
return count;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user