Fix build warning based on GCC-9 71/221771/1
authormk5004.lee <mk5004.lee@samsung.com>
Tue, 7 Jan 2020 09:41:22 +0000 (18:41 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Tue, 7 Jan 2020 09:41:22 +0000 (18:41 +0900)
Change-Id: I005d5842fb7e4b55da2c08a9c59d8547d174f4a7
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
notification-ex/manager.cc
notification-ex/reporter.cc
notification/src/notification.c
notification/src/notification_setting_service.c

index a66703c..79df325 100644 (file)
@@ -126,7 +126,7 @@ unique_ptr<item::AbstractItem> Manager::FindByRootID(string id) {
   }
   Bundle b = result.front();
   unique_ptr<AbstractItem> gen_item = ItemInflator::Create(b);
-  return move(gen_item);
+  return gen_item;
 }
 
 list<unique_ptr<item::AbstractItem>> Manager::Get(string channel) {
@@ -137,7 +137,7 @@ list<unique_ptr<item::AbstractItem>> Manager::Get(string channel) {
     unique_ptr<AbstractItem> 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,
index 67060db..c8ce91a 100644 (file)
@@ -132,7 +132,7 @@ std::unique_ptr<AbstractItem> Reporter::FindByRootID(std::string id) {
   }
   Bundle b = result.front();
   unique_ptr<AbstractItem> gen_item = ItemInflator::Create(b);
-  return move(gen_item);
+  return gen_item;
 }
 
 int Reporter::SendEvent(const IEventInfo& info,
index 7ad2cde..870e870 100644 (file)
@@ -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++;
index 656b919..f757e2e 100644 (file)
@@ -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 */
                }