From f22342961e5b741142886c371553f706b07015d5 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 11 Aug 2021 15:20:50 +0900 Subject: [PATCH] Fix defects detected by static analysis tool Change-Id: I31b8d14b703b4e86693fe5dbbcae98f004380848 --- src/package_update_monitor.cpp | 2 +- src/service_main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/package_update_monitor.cpp b/src/package_update_monitor.cpp index db2d16e..112fff8 100644 --- a/src/package_update_monitor.cpp +++ b/src/package_update_monitor.cpp @@ -73,7 +73,7 @@ static bool is_wakeup_engine(const pkgmgrinfo_appinfo_h handle, CPackageUpdateMo if (PMINFO_R_OK == ret && NULL != appid) { for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM;loop++) { if (clientInfo.getItems()[loop].used) { - for (int inner_loop; inner_loop < MAX_WAKEUP_ENGINES_NUM;inner_loop++) { + for (int inner_loop = 0;inner_loop < MAX_WAKEUP_ENGINES_NUM;inner_loop++) { LOGD("comparing appid : %s %s", clientInfo.getItems()[loop].wakeup_engine[inner_loop], appid); if (0 == strncmp(clientInfo.getItems()[loop].wakeup_engine[inner_loop], appid, MAX_APPID_LEN)) { is_wakeup_engine = true; diff --git a/src/service_main.cpp b/src/service_main.cpp index 8d0d1d2..ac25d36 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -1248,7 +1248,7 @@ bool CServiceMain::is_valid_wakeup_engine(const char* appid) for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM;loop++) { ClientInfoItems *items = mClientInfo.getItems(); if (items[loop].used) { - for (int inner_loop; inner_loop < MAX_WAKEUP_ENGINES_NUM;inner_loop++) { + for (int inner_loop = 0;inner_loop < MAX_WAKEUP_ENGINES_NUM;inner_loop++) { LOGD("comparing appid : %s %s", items[loop].wakeup_engine[inner_loop], appid); if (0 == strncmp(items[loop].wakeup_engine[inner_loop], appid, MAX_APPID_LEN)) { return true; -- 2.7.4