Compare commits
No commits in common. "cd48b739c1a714268b94956ec0fe66c5280f401c" and "81e477b8936a6a6b27233e9d54ac5041dfa2742f" have entirely different histories.
cd48b739c1
...
81e477b893
@ -16,9 +16,8 @@ add_executable(info2Praktikum_Wortsalat
|
||||
Start_Windows/graphicalGame.c
|
||||
Start_Windows/input.c
|
||||
Start_Windows/main.c
|
||||
Start_Windows/unity/unity.c
|
||||
Start_Windows/unit_tests.c
|
||||
)
|
||||
# Start_Windows/unity/unity.c
|
||||
)
|
||||
|
||||
# Link static libraries
|
||||
target_link_libraries(info2Praktikum_Wortsalat
|
||||
|
||||
@ -24,15 +24,13 @@ int readWords(FILE* file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
}
|
||||
shouldClose = 1;
|
||||
}
|
||||
char line[MAX_LINE_LEN];
|
||||
while (fgets(line, sizeof(line), file) != NULL && count < maxWordCount)
|
||||
while (fgets(words[count], MAX_WORD_LEN, file) != NULL && count < maxWordCount)
|
||||
{
|
||||
char *token = strtok(line, delimiter);
|
||||
char* token = strtok(words[count], delimiter);
|
||||
while (token != NULL && count < maxWordCount)
|
||||
{
|
||||
for (char *p = token; *p; ++p)
|
||||
*p = (char)toupper((unsigned char)*p);
|
||||
|
||||
for (char* p = token; *p; ++p)
|
||||
p* = (char)toupper((unsigned char)*p);
|
||||
strncpy(words[count], token, MAX_WORD_LEN - 1);
|
||||
words[count][MAX_WORD_LEN - 1] = '\0';
|
||||
count++;
|
||||
@ -43,5 +41,5 @@ int readWords(FILE* file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
|
||||
|
||||
if (shouldClose)fclose(file);
|
||||
return (int)count;
|
||||
return(int)count;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user