summaryrefslogtreecommitdiffstats
path: root/updater/install.cpp
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2014-07-09 18:50:05 +0200
committerDees Troy <dees_troy@teamw.in>2017-02-02 17:03:12 +0100
commit8df3191beed34f7cbfc0bfd4041c692f8b98d9a2 (patch)
tree2b63a8ef3f33a81b94d0a0d34ff88afc2ac230c9 /updater/install.cpp
parentgui: Fix Android.mk for TW_CUSTOM_THEME (diff)
downloadandroid_bootable_recovery-8df3191beed34f7cbfc0bfd4041c692f8b98d9a2.tar
android_bootable_recovery-8df3191beed34f7cbfc0bfd4041c692f8b98d9a2.tar.gz
android_bootable_recovery-8df3191beed34f7cbfc0bfd4041c692f8b98d9a2.tar.bz2
android_bootable_recovery-8df3191beed34f7cbfc0bfd4041c692f8b98d9a2.tar.lz
android_bootable_recovery-8df3191beed34f7cbfc0bfd4041c692f8b98d9a2.tar.xz
android_bootable_recovery-8df3191beed34f7cbfc0bfd4041c692f8b98d9a2.tar.zst
android_bootable_recovery-8df3191beed34f7cbfc0bfd4041c692f8b98d9a2.zip
Diffstat (limited to 'updater/install.cpp')
-rw-r--r--updater/install.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/updater/install.cpp b/updater/install.cpp
index b17c34fb2..d4ae64ee5 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -1456,6 +1456,7 @@ Value* RebootNowFn(const char* name, State* state, int argc, Expr* argv[]) {
memset(buffer, 0, sizeof(((struct bootloader_message*)0)->command));
FILE* f = fopen(filename, "r+b");
fseek(f, offsetof(struct bootloader_message, command), SEEK_SET);
+ fseek(f, BOOTLOADER_MESSAGE_OFFSET_IN_MISC, SEEK_CUR);
ota_fwrite(buffer, sizeof(((struct bootloader_message*)0)->command), 1, f);
fclose(f);
free(filename);
@@ -1498,6 +1499,7 @@ Value* SetStageFn(const char* name, State* state, int argc, Expr* argv[]) {
// package installation.
FILE* f = fopen(filename, "r+b");
fseek(f, offsetof(struct bootloader_message, stage), SEEK_SET);
+ fseek(f, BOOTLOADER_MESSAGE_OFFSET_IN_MISC, SEEK_CUR);
int to_write = strlen(stagestr)+1;
int max_size = sizeof(((struct bootloader_message*)0)->stage);
if (to_write > max_size) {
@@ -1524,6 +1526,7 @@ Value* GetStageFn(const char* name, State* state, int argc, Expr* argv[]) {
char buffer[sizeof(((struct bootloader_message*)0)->stage)];
FILE* f = fopen(filename, "rb");
fseek(f, offsetof(struct bootloader_message, stage), SEEK_SET);
+ fseek(f, BOOTLOADER_MESSAGE_OFFSET_IN_MISC, SEEK_CUR);
ota_fread(buffer, sizeof(buffer), 1, f);
fclose(f);
buffer[sizeof(buffer)-1] = '\0';