input.c fix

This commit is contained in:
Nils Kuebler 2025-11-04 10:48:53 +01:00
parent 6654f3340a
commit 81e477b893

View File

@ -30,7 +30,7 @@ int readWords(FILE* file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
while (token != NULL && count < maxWordCount) while (token != NULL && count < maxWordCount)
{ {
for (char* p = token; *p; ++p) for (char* p = token; *p; ++p)
(char)toupper((unsigned char)*p); p* = (char)toupper((unsigned char)*p);
strncpy(words[count], token, MAX_WORD_LEN - 1); strncpy(words[count], token, MAX_WORD_LEN - 1);
words[count][MAX_WORD_LEN - 1] = '\0'; words[count][MAX_WORD_LEN - 1] = '\0';
count++; count++;