When counting words, check the correct character variable to see whether it's

a space or not.

Noticed by: bde
This commit is contained in:
Tim J. Robbins 2002-06-16 06:04:43 +00:00
parent 52154faa5f
commit abd0c85dcd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98291

View File

@ -140,7 +140,7 @@ cnt(file)
int clen, fd, len, warned;
short gotsp;
u_char *p;
u_char buf[MAXBSIZE], ch;
u_char buf[MAXBSIZE];
wchar_t wch;
linect = wordct = charct = 0;
@ -235,7 +235,7 @@ word: gotsp = 1;
if (wch == L'\n')
++linect;
/* XXX Non-portable; should use iswspace() */
if (isspace(ch))
if (isspace(wch))
gotsp = 1;
else if (gotsp) {
gotsp = 0;