未验证 提交 3bedcbb4 编写于 作者: M Minglei Jin 提交者: GitHub

Merge pull request #10682 from taosdata/fix/TS-1306

[TS-1306]<fix>: fix endless loop with utf-8 replacement character
......@@ -545,6 +545,9 @@ static void shellPrintNChar(const char *str, int length, int width) {
if (bytes <= 0) {
break;
}
if (pos + bytes > length) {
break;
}
int w = 0;
#ifdef WINDOWS
w = bytes;
......@@ -555,11 +558,11 @@ static void shellPrintNChar(const char *str, int length, int width) {
w = wcwidth(wc);
}
#endif
pos += bytes;
if (w <= 0) {
continue;
}
pos += bytes;
if (pos > length) {
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册