summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthik <kv.bhat@samsung.com>2021-07-30 17:26:51 +0530
committerKarthik <kv.bhat@samsung.com>2021-07-30 18:49:04 +0530
commit9428cdae2631fe1b89fe6526d4d10679977f8912 (patch)
tree6aac90b456f80044a0b5eed1685a08c76dff0c59
parent882edf8245af82cc3fc588a89edfd37c725dc7c2 (diff)
downloadqemu-9428cdae2631fe1b89fe6526d4d10679977f8912.tar.gz
qemu-9428cdae2631fe1b89fe6526d4d10679977f8912.tar.bz2
qemu-9428cdae2631fe1b89fe6526d4d10679977f8912.zip
Fix on-demand installation failure
Change-Id: Ic9bd76cd874d395593f0a46a322f394f890a6055 Signed-off-by: Karthik <kv.bhat@samsung.com>
-rw-r--r--tizen/src/util/extra_pkgs_install.c15
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);
}
}