提交 cd7e59cf 编写于 作者: S slguan

fix issue #503

上级 2c800e3c
......@@ -312,7 +312,12 @@ void shellPrintNChar(char *str, int width, bool printMode) {
if (*str == '\0') break;
char *tstr = str;
int byte_width = mbtowc(&wc, tstr, MB_CUR_MAX);
if (byte_width <= 0 ) break;
int col_width = wcwidth(wc);
if (col_width <= 0) {
str += byte_width;
continue;
}
if (col_left < col_width) break;
printf("%lc", wc);
str += byte_width;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册