From da54c00f6ecf1ed74c81abe2b7e1e2c750849448 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Tue, 11 Apr 2017 11:22:57 +0900 Subject: [PATCH] Fix bug on setting tep option Change-Id: I8a82b80651cbe1ddf9d826d3a10542f6f04afd96 Signed-off-by: Sangyoon Jang --- src/pkg_cmd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pkg_cmd.c b/src/pkg_cmd.c index b061591..3fcdd46 100644 --- a/src/pkg_cmd.c +++ b/src/pkg_cmd.c @@ -142,8 +142,8 @@ struct pm_tool_args_t { char resolved_path_delta_pkg[PATH_MAX]; char label[PKG_NAME_STRING_LEN_MAX]; char tep_path[PATH_MAX]; - char tep_move[PKG_NAME_STRING_LEN_MAX]; + bool tep_move; int global; int type; int result; @@ -1272,8 +1272,8 @@ int main(int argc, char *argv[]) memset(data.pkg_type, '\0', PKG_TYPE_STRING_LEN_MAX); memset(data.label, '\0', PKG_TYPE_STRING_LEN_MAX); memset(data.tep_path, '\0', PATH_MAX); - memset(data.tep_move, '\0', PKG_NAME_STRING_LEN_MAX); + data.tep_move = 0; data.global = 0; /* By default pkg_cmd will manage for the current user */ data.result = 0; data.type = -1; @@ -1432,8 +1432,7 @@ int main(int argc, char *argv[]) case 'M': /*tep move*/ if (optarg) - strncpy(data.tep_move, (atoi(optarg) == 1) ? "tep_move" : "tep_copy", - PKG_NAME_STRING_LEN_MAX - 1); + data.tep_move = (atoi(optarg) == 1) ? true : false; break; case 't': /* package type */ -- 2.7.4