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

pin entry fails if pin contains leading zeros #13

Open
barfnordsen opened this issue Jun 22, 2023 · 4 comments
Open

pin entry fails if pin contains leading zeros #13

barfnordsen opened this issue Jun 22, 2023 · 4 comments

Comments

@barfnordsen
Copy link

samtvcli pair --pin 0077
Error: invalid argument "0077" for "--pin" flag: strconv.ParseInt: parsing "0077": invalid syntax

@McKael
Copy link
Owner

McKael commented Jun 22, 2023

I cannot reproduce with "0077" but, indeed, the logic is buggy when the PIN code starts with a 0 (and... the flag library seems to parse the number as an octal value, so 0123 would be converted to 83, and "0876" can't be parsed).

I've never had a PIN code starting with a 0 on my Samsung (and I've tried without success), did you really get "0077"?
(I still don't understand why 0077 would trigger this error message.)

@barfnordsen
Copy link
Author

barfnordsen commented Jun 22, 2023

i got a few with leading zeros. i remember got 0088. not sure about 0077. but my tv showed every second or third pairing attempt a pin with leading zeros. resulting in this error everytime.

found this in my windows shell:
.\samtvcli.exe pair --pin 0091
Error: invalid argument "0091" for "--pin" flag: strconv.ParseInt: parsing "0091": invalid syntax

i then switched to linux, hoping its just a windows issue. but had same issues.

@McKael
Copy link
Owner

McKael commented Jun 22, 2023

Okay, 0088 would explain this error message.

I'll switch the flag to a string (it makes more sense anyway)... Thanks for the report!

@barfnordsen
Copy link
Author

Thank you :)

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