diff --git a/top/top.c b/top/top.c index 49f3732e..7677ce6b 100644 --- a/top/top.c +++ b/top/top.c @@ -723,10 +723,10 @@ static int utf8_proper_col (const char *str, int col, int tophysical) { while (*p) { // -1 represents a decoding error, don't encourage repositioning ... if (0 > (clen = UTF8_tab[*p])) return col; - if (tophysical && cnum + 1 > col) break; + if (cnum + 1 > col && tophysical) break; p += clen; tlen += clen; - if (!tophysical && tlen > col) break; + if (tlen > col && !tophysical) break; ++cnum; } return tophysical ? tlen : cnum;