oma-lwm2m: Handle text/plain floatfix numbers without decimal point
Fixes bug: If no decimal point is present then the entire number is treated as the decimal part instead of the integer part
This commit is contained in:
parent
c5bea81bb6
commit
99c77bda8c
|
@ -100,6 +100,11 @@ lwm2m_plain_text_read_float32fix(const uint8_t *inbuf, size_t len,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(dot == 0) {
|
||||||
|
integerpart = counter;
|
||||||
|
counter = 0;
|
||||||
|
frac = 1;
|
||||||
|
}
|
||||||
*value = integerpart << bits;
|
*value = integerpart << bits;
|
||||||
if(frac > 1) {
|
if(frac > 1) {
|
||||||
*value += ((counter << bits) / frac);
|
*value += ((counter << bits) / frac);
|
||||||
|
|
Loading…
Reference in a new issue