From: SangYoun Kwak Date: Tue, 30 Jul 2024 07:48:51 +0000 (+0900) Subject: fota: Fix wrongly written "boot mode" to "upgrade type" X-Git-Tag: accepted/tizen/unified/20240731.160147^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified_dev;p=platform%2Fcore%2Fsystem%2Fupdate-control.git fota: Fix wrongly written "boot mode" to "upgrade type" The log message for the failure of calling hal_device_board_get_upgrade_type() function should be about upgrade type but "boot mode" is used. It should be fixed. Comparing two string with strncmp, a string variable "upgrade_type" and constant string "online", compare length should be provided as "sizeof( upgrade_type)" but "sizeof(boot_mode)" is used. Their buffer size(boot_mode and upgrade_type) are same so it was not making any errors so far but it should be fixed. Change-Id: I580d04d982b943325643aae885bf5c91dae8c0c5 Signed-off-by: SangYoun Kwak --- diff --git a/update-manager/fota/fota-installer.c b/update-manager/fota/fota-installer.c index 25cd04d..7b4cd3d 100644 --- a/update-manager/fota/fota-installer.c +++ b/update-manager/fota/fota-installer.c @@ -483,7 +483,7 @@ static int get_upgrade_completed(bool *upgrade_completed) ret = hal_device_board_get_upgrade_type(upgrade_type, sizeof(upgrade_type)); if (ret < 0) { - _FLOGE("Failed to get boot mode: %d", ret); + _FLOGE("Failed to get upgrade type: %d", ret); return -1; } @@ -500,7 +500,7 @@ static int get_upgrade_completed(bool *upgrade_completed) return 0; } - if (strncmp(upgrade_type, "online", sizeof(boot_mode)) != 0) { + if (strncmp(upgrade_type, "online", sizeof(upgrade_type)) != 0) { *upgrade_completed = false; return 0; }