Merge remote-tracking branch 'origin/main' into Lilli

This commit is contained in:
kuehnemundli103965 committed 2026-10-25 10:49:59 +01:00
commit a125bd02cb
2 files changed
+20

No files matched your search

+20
View File
@@ -8,5 +8,25 @@
// Read words from file and store in 'words' array
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
{
char line[1024];
unsigned int count = 0;
if (file == NULL)
return 0;
while (count < maxWordCount && fgets(line, sizeof(line), file) != NULL)
{
char *word = strtok(line, ",; \t\r\n");
while (word != NULL && count < maxWordCount)
{
strncpy(words[count], word, MAX_WORD_LEN - 1);
words[count][MAX_WORD_LEN - 1] = '\0';
count++;
word = strtok(NULL, ",; \t\r\n");
}
}
return count;
}
BIN
View File
Binary file not shown.