Skip to content

Conversation

@waruqi
Copy link

@waruqi waruqi commented Aug 16, 2022

cmdline 这块解析之前还能正常跑,新版本直接获取到一串非截断乱码。

while (len > 0 && (buf[len - 1] <= 0 || buf[len - 1] == 10 || buf[len - 1] == 13)) --len;

问题1: 为啥要改成尾遍历,如果 X 是无效字符,abd X edf XXXX 中间如果出现部分有效字符,这样获取的 len 就是有问题的,得从 0 开始遍历才对。

return new String(buf, StandardCharsets.US_ASCII);

问题2: 最后那个 len 算完,也没用进去哈。。。

@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants