From: Junghyun Yeon Date: Tue, 29 Oct 2019 09:54:23 +0000 (+0900) Subject: Fix code to initialize variable for every loop X-Git-Tag: submit/tizen/20191112.050420~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f66ff02ef1c2ae3b8d6efcf655a2cc21d846ea5f;p=platform%2Fcore%2Fappfw%2Fpkgmgr-tool.git Fix code to initialize variable for every loop Without this change, previous operation type will not be initialized and it could affect next loop. Change-Id: Id514928d11b67fbc58d81a92deb3ee0506459e13 Signed-off-by: Junghyun Yeon --- diff --git a/src/pkg_upgrade.c b/src/pkg_upgrade.c index ff9bc05..a5c484e 100644 --- a/src/pkg_upgrade.c +++ b/src/pkg_upgrade.c @@ -826,7 +826,7 @@ static int __find_matched_pkgid_from_list(const char *source_file, int total_pkg_cnt = 0; int compare_result = 0; - int operation = PKG_NEED_NOTHING; + int operation; bool db_update; @@ -854,6 +854,7 @@ static int __find_matched_pkgid_from_list(const char *source_file, continue; } + operation = PKG_NEED_NOTHING; compare_result = __compare_pkgid((char *)target_file, pkgid, version, &db_update); if (compare_result == PKG_IS_NOT_EXIST) {