darconeous / libnyoci

A flexible CoAP stack for embedded devices and computers. RFC7252 compatible.
Other
27 stars 10 forks source link

Fixed a logic error due to missing parens #16

Closed snej closed 6 years ago

snej commented 6 years ago

== has higher precedence than &, so the expression wasn’t doing what was intended.

This was caught by GCC's -Wparentheses:

libnyoci/src/libnyoci/nyoci-outbound.c:323:41: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses]
    && (self->current_transaction->flags & NYOCI_TRANSACTION_OBSERVE == NYOCI_TRANSACTION_OBSERVE)
                                         ^