sensord: use memcpy instead of copying values 17/64517/1
authorkibak.yoon <kibak.yoon@samsung.com>
Thu, 31 Mar 2016 10:19:13 +0000 (19:19 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Fri, 1 Apr 2016 12:11:00 +0000 (21:11 +0900)
* if value_count is over 16(max value count), it makes a problem when
  values is copied in loop.

Change-Id: I8f07fe76909fe995027a604ac18bb9cdb6fbf827
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/client/command_channel.cpp

index ca6b025..da07846 100644 (file)
@@ -589,15 +589,7 @@ bool command_channel::cmd_get_data(unsigned int type, sensor_data_t* sensor_data
                return false;
        }
 
-       sensor_data_t *base_data;
-       base_data = &cmd_get_data_done->base_data;
-
-       sensor_data->timestamp = base_data->timestamp;
-       sensor_data->accuracy = base_data->accuracy;
-       sensor_data->value_count = base_data->value_count;
-
-       memcpy(sensor_data->values, base_data->values,
-               sizeof(sensor_data->values[0]) * base_data->value_count);
+       memcpy(sensor_data, &cmd_get_data_done->base_data, sizeof(sensor_data_t));
 
        delete[] (char *)cmd_get_data_done;
        delete packet;