input . c fix
This commit is contained in:
parent
81e477b893
commit
5232636f79
@ -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)
|
||||||
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++;
|
||||||
@ -41,5 +41,5 @@ int readWords(FILE* file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
|
|
||||||
|
|
||||||
if (shouldClose)fclose(file);
|
if (shouldClose)fclose(file);
|
||||||
return(int)count;
|
return (int)count;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user