Skip to content

Fix conditional typo on client-publish-service.c#635

Merged
evverx merged 2 commits intoavahi:masterfrom
iscle:patch-1
Aug 20, 2024
Merged

Fix conditional typo on client-publish-service.c#635
evverx merged 2 commits intoavahi:masterfrom
iscle:patch-1

Conversation

@iscle
Copy link
Copy Markdown
Contributor

@iscle iscle commented Aug 20, 2024

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.

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.
Copy link
Copy Markdown
Collaborator

@evverx evverx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@iscle
Copy link
Copy Markdown
Contributor Author

iscle commented Aug 20, 2024

Thanks for the quick response, @evverx!

Done, I've fixed in on the other one too! :)

@evverx evverx merged commit 8e77303 into avahi:master Aug 20, 2024
@iscle iscle deleted the patch-1 branch August 20, 2024 12:25
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.

2 participants