diff options
author | Maxim Siniavine <siniavine@google.com> | 2014-02-14 01:03:28 +0100 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-02-14 01:03:28 +0100 |
commit | 48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb (patch) | |
tree | 24f52ed69b2b8ac11dd94a4699109aa02fea21f5 | |
parent | remove remaining libminelf references (diff) | |
parent | Fix a crash when going into recovery mode. (diff) | |
download | android_bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.tar android_bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.tar.gz android_bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.tar.bz2 android_bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.tar.lz android_bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.tar.xz android_bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.tar.zst android_bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.zip |
-rw-r--r-- | uncrypt/uncrypt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/uncrypt/uncrypt.c b/uncrypt/uncrypt.c index 1f0f59dba..7c2d99477 100644 --- a/uncrypt/uncrypt.c +++ b/uncrypt/uncrypt.c @@ -149,9 +149,14 @@ char* parse_recovery_command_file() int count = 0; char temp[1024]; - FILE* fo = fopen(RECOVERY_COMMAND_FILE_TMP, "w"); + FILE* f = fopen(RECOVERY_COMMAND_FILE, "r"); + if (f == NULL) { + return NULL; + } + FILE* fo = fopen(RECOVERY_COMMAND_FILE_TMP, "w"); + while (fgets(temp, sizeof(temp), f)) { printf("read: %s", temp); if (strncmp(temp, "--update_package=", strlen("--update_package=")) == 0) { |