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

当 --repeat-times 参数为负数的时候的 bug #12

Closed
pexcn opened this issue Sep 5, 2019 · 2 comments
Closed

当 --repeat-times 参数为负数的时候的 bug #12

pexcn opened this issue Sep 5, 2019 · 2 comments

Comments

@pexcn
Copy link
Contributor

pexcn commented Sep 5, 2019

# 当 -p -1 时,日志显示:
2019-09-05 09:31:10 INF: [main] enable repeat mode, times: 255

# 当 -p -2 时,日志显示:
2019-09-05 09:31:13 INF: [main] enable repeat mode, times: 254
@zfl9
Copy link
Owner

zfl9 commented Sep 5, 2019

正常,因为内部使用的是无符号整数,-1 等价于 255,-2 等价于 254,实际取值范围只有 0-255,总共 256 个值,0 不允许设置,有效范围为 1-255。这不是 bug。如有疑问请不要使用负数。具体请看 C 语言的无符号数与有符号数。

@pexcn
Copy link
Contributor Author

pexcn commented Sep 5, 2019

😄 只是测试一下能否正确处理...

@pexcn pexcn closed this as completed Sep 5, 2019
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

No branches or pull requests

2 participants