Use an int to hold the result of fgetc (bug noted by David Kimdon).
This commit is contained in:
parent
72812d3143
commit
741f40b58e
@ -68,7 +68,7 @@ static void wc_file(FILE * file, const char *name)
|
|||||||
unsigned int length = 0;
|
unsigned int length = 0;
|
||||||
unsigned int linepos = 0;
|
unsigned int linepos = 0;
|
||||||
char in_word = 0;
|
char in_word = 0;
|
||||||
char c;
|
int c;
|
||||||
|
|
||||||
while ((c = getc(file)) != EOF) {
|
while ((c = getc(file)) != EOF) {
|
||||||
chars++;
|
chars++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user