2 Apr
2014
2 Apr
'14
10:37 p.m.
On Wed, Apr 2, 2014 at 9:58 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Knoth wrote:
On Wed, Apr 02, 2014 at 09:29:20PM +0200, Clemens Ladisch wrote:
len = b[0] - 0x80;
if ((len > 1) && (3 < len) && (s->midi[port]))
This condition is true only for len==2.
I don't know if len can be larger than 3. If so, the condition requires len to be at least 4.
Oops, you're right. (The goal is do detect 1..3.)
The condition looks like it's equal to
if ((len > 1) && (len > 3) && (s->midi[port]))
or simply
if ((len > 3) && (s->midi[port]))
Perhaps in these cases it's better to have either same order of operands or same/similar operators...
Jano