From 64342e93971fa84abb9eb0bc336bcc4c1933fec6 Mon Sep 17 00:00:00 2001 From: Yunmi Ha Date: Mon, 30 Dec 2019 15:12:27 +0900 Subject: [PATCH] Remove compile warning for GCC-9 - duplicate-decl-specifier - stringop-overflow Change-Id: I00d982265657becd05cb9bed068a167b9304d417 Signed-off-by: Yunmi Ha --- src/common/tlm-utils.c | 8 ++++---- src/common/tlm-utils.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/tlm-utils.c b/src/common/tlm-utils.c index db4340f..d5a372a 100755 --- a/src/common/tlm-utils.c +++ b/src/common/tlm-utils.c @@ -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; diff --git a/src/common/tlm-utils.h b/src/common/tlm-utils.h index 4c83d06..cdb836f 100755 --- a/src/common/tlm-utils.h +++ b/src/common/tlm-utils.h @@ -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); -- 2.7.4