Date: Mon, 19 Mar 2001 23:48:13 -0700 From: Warner Losh <imp@harmony.village.org> To: "Michael C . Wu" <keichii@peorth.iteration.net> Cc: current@freebsd.org, ache@freebsd.org, i18n@freebsd.org Subject: Re: Request for review [Re: /bin/ls patch round #2] Message-ID: <200103200648.f2K6mD912877@harmony.village.org> In-Reply-To: Your message of "Tue, 20 Mar 2001 00:20:43 CST." <20010320002043.A46115@peorth.iteration.net> References: <20010320002043.A46115@peorth.iteration.net> <20010319195438.A43266@peorth.iteration.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20010320002043.A46115@peorth.iteration.net> "Michael C . Wu" writes: : | + while(*p1 != 0) { while (*p1 != '\0') { : | + c = sgetrune(p1, dc, &p2); : | + if(c == _INVALID_RUNE) { space after the if. ditto further . : | + p1++; : | + dc--; : | + *ri++ = '?'; : | + } else { : | + dc -= p2 - p1; : | + if(isprint(c)) : | + while(p1 != p2) : | + *ri++ = *p1++; : | + else : | + while(p1 != p2) { : | + *ri++ = '?'; : | + p1++; : | + } I think this might be clearer: if (isprint(c)) strlcpy(ri, p1, p2 - p1); else memset(ri, '?', p2 - p1); ri += (p2 - p1); p1 = p2; : | + return len; Style(9) wants parens around (len). Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-i18n" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103200648.f2K6mD912877>