sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit d412dad4709299674f5d0b137ccbb95a031815f2
parent cd0b771cbbb56096335c1f2d8a0c953d46b0d430
Author: sin <sin@2f30.org>
Date:   Mon, 20 Apr 2015 11:26:05 +0100

Simplify condition in wc(1)

Diffstat:
Mwc.c | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/wc.c b/wc.c @@ -32,8 +32,7 @@ wc(FILE *fp, const char *str) size_t nc = 0, nl = 0, nw = 0; while ((rlen = efgetrune(&c, fp, str))) { - nc += (cmode == 'c' || !cmode) ? rlen : - (c != Runeerror) ? 1 : 0; + nc += (cmode == 'c' || !cmode) ? rlen : (c != Runeerror); if (c == '\n') nl++; if (!isspacerune(c))