summaryrefslogtreecommitdiffstats
path: root/bootloader_message/bootloader_message.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-12-13 02:06:24 +0100
committerTao Bao <tbao@google.com>2016-12-13 02:06:24 +0100
commit26d5ae741efd904fdc20187eddad33ca31dd64fa (patch)
treeff4695e61fdb52f49a663610dbcffaec376187fb /bootloader_message/bootloader_message.cpp
parentwrite_bootloader_message(<options>) should not reset stage field. (diff)
downloadandroid_bootable_recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.tar
android_bootable_recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.tar.gz
android_bootable_recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.tar.bz2
android_bootable_recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.tar.lz
android_bootable_recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.tar.xz
android_bootable_recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.tar.zst
android_bootable_recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.zip
Diffstat (limited to 'bootloader_message/bootloader_message.cpp')
-rw-r--r--bootloader_message/bootloader_message.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp
index 294b1725d..9a5671843 100644
--- a/bootloader_message/bootloader_message.cpp
+++ b/bootloader_message/bootloader_message.cpp
@@ -164,13 +164,7 @@ bool clear_bootloader_message(std::string* err) {
}
bool write_bootloader_message(const std::vector<std::string>& options, std::string* err) {
- bootloader_message boot;
- if (!read_bootloader_message(&boot, err)) {
- return false;
- }
- // Zero out the entire fields.
- memset(boot.command, 0, sizeof(boot.command));
- memset(boot.recovery, 0, sizeof(boot.recovery));
+ bootloader_message boot = {};
strlcpy(boot.command, "boot-recovery", sizeof(boot.command));
strlcpy(boot.recovery, "recovery\n", sizeof(boot.recovery));
for (const auto& s : options) {