Fix mistaken use of && where & was intended
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 5 Sep 2014 01:20:13 +0000 (18:20 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 11 Sep 2014 17:59:52 +0000 (10:59 -0700)
Found by Clang:
occoaphelper.c:93:59: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]

It's clearly meant to be a &, as seen by the right shift by 5 and the
constant of 31 (5 bits)

Change-Id: Ie35ad6c313ad53d766fc6fe88ffd03b462d49519
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
csdk/occoap/src/occoaphelper.c

index 521c953..cb12f78 100644 (file)
@@ -90,7 +90,7 @@ OCStackResult CoAPToOCResponseCode(uint8_t coapCode)
             break;
 
         default:
-            decimal = ((coapCode >> 5) * 100) + (coapCode && 31);
+            decimal = ((coapCode >> 5) * 100) + (coapCode & 31);
             if (decimal >= 200 && decimal <= 231)
             {
                 ret = OC_STACK_OK;