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

generate: fix type for option parsing #346

Merged
merged 1 commit into from
Oct 26, 2017
Merged

Conversation

ncopa
Copy link
Contributor

@ncopa ncopa commented Oct 26, 2017

char may or may not be signed depending on architecture. If char is
unsigned on a given architecture, then will the testing the return value
from getopt_long (which is int) always fail. This happened on some
architectures like ppc64le, aarch64 and s390x.

To fix this we use same type as getopt_long return value: int.

fixes #345

Signed-off-by: Natanael Copa ncopa@alpinelinux.org

char may or may not be signed depending on architecture. If char is
unsigned on a given architecture, then will the testing the return value
from getopt_long (which is int) always fail. This happened on some
architectures like ppc64le, aarch64 and s390x.

To fix this we use same type as getopt_long return value: int.

fixes lastpass#345

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
@bcopeland
Copy link
Contributor

Nice find - I was scratching my head at the bug report since I didn't see any endian-sensitive options in the generate command. Thanks!

@bcopeland bcopeland merged commit 8d086f6 into lastpass:master Oct 26, 2017
@ncopa ncopa deleted the fix-generate branch October 27, 2017 06:28
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.

test suite test_generate fails on aarch64, ppc64le and s390x (musl libc)
2 participants