From: kibak.yoon Date: Thu, 31 Mar 2016 10:19:13 +0000 (+0900) Subject: sensord: use memcpy instead of copying values X-Git-Tag: accepted/tizen/common/20160406.143452~1^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce4f6a793d5f3c70f834b8338464d079cbecb1e4;p=platform%2Fcore%2Fsystem%2Fsensord.git sensord: use memcpy instead of copying values * 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 --- diff --git a/src/client/command_channel.cpp b/src/client/command_channel.cpp index ca6b025..da07846 100644 --- a/src/client/command_channel.cpp +++ b/src/client/command_channel.cpp @@ -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;