diff options
author | Sanrio Alvares <sanrio.alvares@intel.com> | 2016-10-31 02:01:10 -0700 |
---|---|---|
committer | Beare, Bruce J <bruce.j.beare@intel.com> | 2016-11-30 08:12:32 -0800 |
commit | d05c8f83f3670d0cbdc7ae57b0fda78620e00cdd (patch) | |
tree | 6ca04f5a9955bce99e3b11b773b88ff60b1feb65 | |
parent | c1b4ce56eba14930c375d8c2acf34a96466b7405 (diff) | |
download | edison-u-boot-d05c8f83f3670d0cbdc7ae57b0fda78620e00cdd.tar.gz |
Clear command field
Once read, clear the command field in misc.
Change-Id: I48422860736cba48b6c7c3339bccdb033bf88525
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Reviewed-on: https://android.intel.com/548646
Reviewed-by: Beare, Bruce J <bruce.j.beare@intel.com>
Tested-by: Beare, Bruce J <bruce.j.beare@intel.com>
-rw-r--r-- | common/cmd_boot_brillo.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/common/cmd_boot_brillo.c b/common/cmd_boot_brillo.c index 3f11f8e8d3..dc92ecb165 100644 --- a/common/cmd_boot_brillo.c +++ b/common/cmd_boot_brillo.c @@ -653,7 +653,7 @@ static int read_boot_reason(void) block_dev_desc_t *dev; disk_partition_t misc_part; char command[33] = {'\0'}; - int i, ret; + int ret; uint8_t target; /* RM Key is pressed on Edison Arduino Board */ @@ -675,8 +675,11 @@ static int read_boot_reason(void) goto skip_bootctl; } - for (i=0; i<32; i++) - sprintf(&command[i], "%c", message.message.command[i]); + strncpy(command, message.message.command, sizeof(message.message.command)); + memcpy(message.message.command, 0, sizeof(message.message.command)); + if (ab_write_bootloader_message(dev, &misc_part, &message)) { + printf("WARNING: couldn't write bootloader message\n"); + } skip_bootctl: /* Read reboot reason written in OSNIB */ |