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

ldap: adapt to conn->port now being an 'int' #9281

Closed
wants to merge 1 commit into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Aug 8, 2022

Remove typecasts. Fix printf() formats.

Follow-up from 764c6bd.
Pointed out by Coverity CID 1507858.

Remove typecasts. Fix printf() formats.

Follow-up from 764c6bd.
Pointed out by Coverity CID 1507858.
@bagder bagder closed this in ca528d1 Aug 8, 2022
@bagder bagder deleted the bagder/ldap-conn-port branch Aug 8, 2022
Copy link
Contributor

@emilengler emilengler left a comment

Isn't %d more natural for an int?

@bagder
Copy link
Member Author

bagder commented Aug 8, 2022

since the output is always unsigned I figured %u makes it more obvious

@emilengler
Copy link
Contributor

emilengler commented Aug 8, 2022

since the output is always unsigned I figured %u makes it more obvious

But, at that point, wouldn't it mane more sense to change conn->port to an unsigned int anyway? Although not the scope of this PR, obviously.

@bagder
Copy link
Member Author

bagder commented Aug 8, 2022

I don't think it does, as that will just cause some more typecasts or require conversions elsewhere. The printf format string is for how it outputs the number, %d and %u both work on the same int input. It's not an error.

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

Successfully merging this pull request may close these issues.

None yet

2 participants