Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert and fix parse cmdline bug #1669

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

revert and fix parse cmdline bug #1669

wants to merge 2 commits into from

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