Fix conditional typo on client-publish-service.c#635
Merged
evverx merged 2 commits intoavahi:masterfrom Aug 20, 2024
Merged
Conversation
A badly placed closing bracket was assigning a comparison to the ret value, instead of the real returned value. The conditional still worked this way, but the fprintf message would be wrong as the strerror value "ret" would always be 1, and not the real returned value.
evverx
reviewed
Aug 20, 2024
Collaborator
evverx
left a comment
There was a problem hiding this comment.
Thank you for the PR!
As far as I can see there is another example with the same issue:
examples/core-publish-service.c:115:8: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition]
if ((ret = avahi_server_add_service_subtype(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, "_magic._sub._printer._tcp") < 0)) {
^Could you fix it there too so that all the examples were correct?
A badly placed closing bracket was assigning a comparison to the ret value, instead of the real returned value. The conditional still worked this way, but the fprintf message would be wrong as the strerror value "ret" would always be 1, and not the real returned value.
Contributor
Author
|
Thanks for the quick response, @evverx! Done, I've fixed in on the other one too! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A badly placed closing bracket was assigning a comparison to the ret value, instead of the real returned value. The conditional still worked this way, but the fprintf message would be wrong as the strerror value "ret" would always be 1, and not the real returned value.