]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Again, fixed decoding of negative integers in snmp_asn1_dec_s32t(), tnx to though...
authorchristiaans <christiaans>
Fri, 13 Oct 2006 13:45:06 +0000 (13:45 +0000)
committerchristiaans <christiaans>
Fri, 13 Oct 2006 13:45:06 +0000 (13:45 +0000)
src/core/snmp/asn1_dec.c

index 48833d63fd167d0e21bdc1f33fa4c74f56a3a366..fcc0888ec9d498ff6688f602eca4752562a1a846 100644 (file)
@@ -366,12 +366,14 @@ snmp_asn1_dec_s32t(struct pbuf *p, u16_t ofs, u16_t len, s32_t *value)
           if (sign)
           {
             *lsb_ptr &= *msg_ptr;
+            *value <<= 8;
+            *lsb_ptr |= 255;
           }
           else
           {
             *lsb_ptr |= *msg_ptr;
+            *value <<= 8;
           }
-          *value <<= 8;
           ofs += 1;
           if (ofs >= plen)
           {