**A typo**

V593 Consider reviewing the expression of the ‘A = B < C' kind. The expression is calculated as following: 'A = (B < C)'. datachannel.cpp 1105

bool DataChannelConnection::SendDeferredMessages()
{
....
if ((result = usrsctp_sendv(mSocket, data, ...., 0) < 0)) {
....
}

A parenthesis is written in a wrong place. Let’s simplify the expression to make the mistake clearer:

if ((result = foo() < 0))

This expression is calculated in the following way. The result returned by the function is compared to 0; then true or false is written into the ‘result’ variable. The mistake is about one of the closing parentheses written in a wrong place. The programmer actually meant the expression to look as follows:

if ((result = foo()) < 0)

In this case, the result returned by the function is first written into the ‘result’ variable and only then is compared to 0.

*Please click here to see more bugs from this project.*

### Like this:

Like Loading...

*Related*