Re: [dev] [sbase][PATCH] wc: Print number of bytes by default

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Sun, 5 Apr 2015 08:51:37 +0200

Hi,

> size_t nc = 0, nl = 0, nw = 0;
>
> while ((rlen = efgetrune(&c, fp, str))) {
> - nc += (cmode == 'c') ? rlen :
> + nc += (cmode == 'c' || cmode == 0) ? rlen :
> (c != Runeerror) ? 1 : 0;
> if (c == '\n')
> nl++;

a '?' inside of other '?' is not a good idea. I think the expression
is complex enough to require an if-else.

Regards,
Received on Sun Apr 05 2015 - 08:51:37 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 05 2015 - 09:00:10 CEST