“cfffb1a36251e7d06535dac6db220131e36fe9f8”上不存在“paddle/phi/ops/compat/huber_loss_sig.cc”
提交 5c97cd8d 编写于 作者: M Minglei Jin

[TS-1306]<fix>: fix endless loop with utf-8 replacement character

上级 01777f58
......@@ -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.
先完成此消息的编辑!
想要评论请 注册