add cksum

This commit is contained in:
Connor Lane Smith
2011-06-10 04:14:05 +01:00
parent f2e86862be
commit 6be3e82218
5 changed files with 109 additions and 3 deletions

2
wc.c
View File

@@ -74,7 +74,7 @@ wc(FILE *fp, const char *str)
char c;
long nc = 0, nl = 0, nw = 0;
while((c = fgetc(fp)) != EOF) {
while((c = getc(fp)) != EOF) {
if(cmode != 'm' || UTF8_POINT(c))
nc++;
if(c == '\n')