Remove compile warning for GCC-9 03/221203/1 accepted/tizen/unified/20200106.141602 submit/tizen/20200103.083647
authorYunmi Ha <yunmi.ha@samsung.com>
Mon, 30 Dec 2019 06:12:27 +0000 (15:12 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Mon, 30 Dec 2019 06:12:27 +0000 (15:12 +0900)
- duplicate-decl-specifier
- stringop-overflow

Change-Id: I00d982265657becd05cb9bed068a167b9304d417
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/common/tlm-utils.c
src/common/tlm-utils.h

index db4340fb613d37b474306339d5f6270677150559..d5a372a0d2ccd0250e3013b54b30cecf63ab125c 100755 (executable)
@@ -86,7 +86,7 @@ tlm_user_get_name (uid_t user_id)
         if (pw_name)
         {
             memset(pw_name, 0, strlen(pwent->pw_name)+1);
-            strncpy(pw_name, pwent->pw_name, strlen(pwent->pw_name));
+            memcpy(pw_name, pwent->pw_name, strlen(pwent->pw_name));
         }
     }
 
@@ -196,7 +196,7 @@ tlm_user_get_home_dir (const gchar *username)
         if (pw_dir)
         {
             memset(pw_dir, 0, strlen(pwent->pw_dir)+1);
-            strncpy(pw_dir, pwent->pw_dir, strlen(pwent->pw_dir));
+            memcpy(pw_dir, pwent->pw_dir, strlen(pwent->pw_dir));
         }
     }
 
@@ -234,7 +234,7 @@ tlm_user_get_shell (const gchar *username)
         if (pw_shell)
         {
             memset(pw_shell, 0, strlen(pwent->pw_shell)+1);
-            strncpy(pw_shell, pwent->pw_shell, strlen(pwent->pw_shell));
+            memcpy(pw_shell, pwent->pw_shell, strlen(pwent->pw_shell));
         }
     }
 
@@ -525,7 +525,7 @@ tlm_utils_split_command_line(const gchar *command) {
 }
 
 GList *
-tlm_utils_split_command_lines (const GList const *commands_list) {
+tlm_utils_split_command_lines (const GList *commands_list) {
   const gchar *pattern = "('.*?'|\".*?\"|\\S+)";
   GError *error = NULL;
   GRegex *regex = NULL;
index 4c83d060d6c410ee0c4501050576b5dd2540b527..cdb836f682a0565b33415e738e8504df99551396 100755 (executable)
@@ -62,7 +62,7 @@ gchar **
 tlm_utils_split_command_line (const gchar *command);
 
 GList *
-tlm_utils_split_command_lines (const GList const *commands_list);
+tlm_utils_split_command_lines (const GList *commands_list);
 
 typedef void (*WatchCb) (const gchar *found_item, gboolean is_final, GError *error, gpointer userdata);