diff options
-rw-r--r-- | tizen/src/util/extra_pkgs_install.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tizen/src/util/extra_pkgs_install.c b/tizen/src/util/extra_pkgs_install.c index 7f033ca7b5..8e30592377 100644 --- a/tizen/src/util/extra_pkgs_install.c +++ b/tizen/src/util/extra_pkgs_install.c @@ -80,12 +80,15 @@ static char *get_addon_path(void) return extra_path; } -static void add_addon_pkgs_name(char *pkgs, char *name, size_t size) +static void add_addon_pkgs_name(char *pkgs, char *name) { - if (strlen(pkgs) == 0) { - strncpy(pkgs, name, size); + int len = strlen(pkgs); + if (len == 0) { + strncpy(pkgs, name, MAX_PKG_LIST-1); } else { - snprintf(pkgs, size, "%s, %s", pkgs, name); + char pkg[MAX_PKG_LIST]; + snprintf(pkg, MAX_PKG_LIST, ", %s", name); + strncat(pkgs,pkg,MAX_PKG_LIST-len-1); } } @@ -225,8 +228,8 @@ void epi_init(void) } pkg_count++; - add_addon_pkgs_name(pkgs, sub_dir_entry->d_name, sizeof(pkgs)); - add_addon_pkgs_name(pkg_list, sub_dir_entry->d_name, sizeof(pkg_list)); + add_addon_pkgs_name(pkgs, sub_dir_entry->d_name); + add_addon_pkgs_name(pkg_list, sub_dir_entry->d_name); LOG_TRACE("reading addon sub directory: %s\n", sub_dir_entry->d_name); } } |