Fix code to initialize variable for every loop 06/216606/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 29 Oct 2019 09:54:23 +0000 (18:54 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 29 Oct 2019 09:54:23 +0000 (18:54 +0900)
Without this change, previous operation type will not be initialized
and it could affect next loop.

Change-Id: Id514928d11b67fbc58d81a92deb3ee0506459e13
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkg_upgrade.c

index ff9bc05e4147fb4019ad694a584a8b03458da511..a5c484ec326d8f414414dde89a3b68abecb09402 100644 (file)
@@ -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) {