From: mk5004.lee Date: Tue, 7 Jan 2020 09:41:22 +0000 (+0900) Subject: Fix build warning based on GCC-9 X-Git-Tag: accepted/tizen/unified/20200108.131517~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F221771%2F1;p=platform%2Fcore%2Fapi%2Fnotification.git Fix build warning based on GCC-9 Change-Id: I005d5842fb7e4b55da2c08a9c59d8547d174f4a7 Signed-off-by: mk5004.lee --- diff --git a/notification-ex/manager.cc b/notification-ex/manager.cc index a66703c..79df325 100644 --- a/notification-ex/manager.cc +++ b/notification-ex/manager.cc @@ -126,7 +126,7 @@ unique_ptr Manager::FindByRootID(string id) { } Bundle b = result.front(); unique_ptr gen_item = ItemInflator::Create(b); - return move(gen_item); + return gen_item; } list> Manager::Get(string channel) { @@ -137,7 +137,7 @@ list> Manager::Get(string channel) { unique_ptr gen_item = ItemInflator::Create(i); gen_list.push_back(move(gen_item)); } - return move(gen_list); + return gen_list; } int Manager::SendEvent(const IEventInfo& info, diff --git a/notification-ex/reporter.cc b/notification-ex/reporter.cc index 67060db..c8ce91a 100644 --- a/notification-ex/reporter.cc +++ b/notification-ex/reporter.cc @@ -132,7 +132,7 @@ std::unique_ptr Reporter::FindByRootID(std::string id) { } Bundle b = result.front(); unique_ptr gen_item = ItemInflator::Create(b); - return move(gen_item); + return gen_item; } int Reporter::SendEvent(const IEventInfo& info, diff --git a/notification/src/notification.c b/notification/src/notification.c index 7ad2cde..870e870 100644 --- a/notification/src/notification.c +++ b/notification/src/notification.c @@ -550,7 +550,7 @@ EXPORT_API int notification_get_text(notification_h noti, "%d ", ret_variable_int); src_len = strlen(result_str); - max_len = NOTI_TEXT_RESULT_LEN - src_len - 1; + max_len = sizeof(result_str) - src_len - 1; strncat(result_str, buf_str, max_len); num_args++; } @@ -606,7 +606,7 @@ EXPORT_API int notification_get_text(notification_h noti, ret_variable_int); src_len = strlen(result_str); - max_len = NOTI_TEXT_RESULT_LEN - src_len - 1; + max_len = sizeof(result_str) - src_len - 1; strncat(result_str, buf_str, max_len); temp_str++; @@ -639,7 +639,7 @@ EXPORT_API int notification_get_text(notification_h noti, sizeof(buf_str) - 1); src_len = strlen(result_str); - max_len = NOTI_TEXT_RESULT_LEN - src_len - 1; + max_len = sizeof(result_str) - src_len - 1; strncat(result_str, buf_str, max_len); } @@ -658,7 +658,7 @@ EXPORT_API int notification_get_text(notification_h noti, ret_variable_double); src_len = strlen(result_str); - max_len = NOTI_TEXT_RESULT_LEN - src_len - 1; + max_len = sizeof(result_str) - src_len - 1; strncat(result_str, buf_str, max_len); temp_str++; @@ -699,7 +699,7 @@ EXPORT_API int notification_get_text(notification_h noti, ret_variable_int); src_len = strlen(result_str); - max_len = NOTI_TEXT_RESULT_LEN - src_len - 1; + max_len = sizeof(result_str) - src_len - 1; strncat(result_str, buf_str, max_len); temp_str += 3; @@ -715,7 +715,7 @@ EXPORT_API int notification_get_text(notification_h noti, ret_val); src_len = strlen(result_str); - max_len = NOTI_TEXT_RESULT_LEN - src_len - 1; + max_len = sizeof(result_str) - src_len - 1; strncat(result_str, buf_str, max_len); temp_str += 3; @@ -733,7 +733,7 @@ EXPORT_API int notification_get_text(notification_h noti, "%.2f", ret_variable_double); src_len = strlen(result_str); - max_len = NOTI_TEXT_RESULT_LEN - src_len - 1; + max_len = sizeof(result_str) - src_len - 1; strncat(result_str, buf_str, max_len); temp_str += 3; @@ -784,7 +784,7 @@ EXPORT_API int notification_get_text(notification_h noti, ret_variable_int); src_len = strlen(result_str); - max_len = NOTI_TEXT_RESULT_LEN - src_len - 1; + max_len = sizeof(result_str) - src_len - 1; strncat(result_str, buf_str, max_len); num_args++; diff --git a/notification/src/notification_setting_service.c b/notification/src/notification_setting_service.c index 656b919..f757e2e 100644 --- a/notification/src/notification_setting_service.c +++ b/notification/src/notification_setting_service.c @@ -79,7 +79,7 @@ static int _get_table_field_data_string(char **table, char **buf, int ucs2, int goto out; } memset(*buf, 0, sLen + 1); - strncpy(*buf, pTemp, sLen); + strncpy(*buf, pTemp, sLen + 1); } else { *buf = NULL; /* LCOV_EXCL_LINE */ }