top: utf8 utils should observe indentation conventions

Gosh, all this time we used indents of 4 spaces, not 3
spaces which were always the top standard indentation.

[ and we made our 'utf8_embody' a little more robust ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2017-10-06 00:00:00 -05:00 committed by Craig Small
parent fba7a919fb
commit ac76afee36

View File

@ -688,12 +688,14 @@ static int utf8_embody (const char *str, int width) {
const unsigned char *p = (const unsigned char *)str;
int clen, cnum = 0;
if (width > 0) {
while (*p) {
// -1 represents a decoding error, pretend it's untranslated ...
if (0 > (clen = UTF8_tab[*p])) return width;
p += clen;
if (++cnum >= width) break;
}
}
return (int)((const char *)p - str);
} // end: utf8_embody