net: lwm2m: fix write_handler sizes for float32/64

Normally, this bug wasn't apparent as the value is type-casted
to a float32/64 type.  However, once we start persisting these
values they need the correct length.

Signed-off-by: Michael Scott <mike@foundries.io>
This commit is contained in:
Michael Scott 2019-02-21 00:52:00 -08:00 committed by Kumar Gala
commit 579e586fa1

View file

@ -2238,13 +2238,13 @@ int lwm2m_write_handler(struct lwm2m_engine_obj_inst *obj_inst,
case LWM2M_RES_TYPE_FLOAT32:
engine_get_float32fix(&msg->in,
(float32_value_t *)data_ptr);
len = 4;
len = sizeof(float32_value_t);
break;
case LWM2M_RES_TYPE_FLOAT64:
engine_get_float64fix(&msg->in,
(float64_value_t *)data_ptr);
len = 8;
len = sizeof(float64_value_t);
break;
default: