summaryrefslogtreecommitdiffstats
path: root/uncrypt/uncrypt.c
diff options
context:
space:
mode:
authorMaxim Siniavine <siniavine@google.com>2014-02-14 00:48:53 +0100
committerMaxim Siniavine <siniavine@google.com>2014-02-14 00:53:38 +0100
commite7b288824589b2828d83e1d47f6f12b0bd0fb353 (patch)
tree67a7d0814abc987c9763ce2d162d742c57c2810d /uncrypt/uncrypt.c
parentam 2739ed96: am a5d105e2: Merge "recovery: fix building with pointer-to-int errors turned on" (diff)
downloadandroid_bootable_recovery-e7b288824589b2828d83e1d47f6f12b0bd0fb353.tar
android_bootable_recovery-e7b288824589b2828d83e1d47f6f12b0bd0fb353.tar.gz
android_bootable_recovery-e7b288824589b2828d83e1d47f6f12b0bd0fb353.tar.bz2
android_bootable_recovery-e7b288824589b2828d83e1d47f6f12b0bd0fb353.tar.lz
android_bootable_recovery-e7b288824589b2828d83e1d47f6f12b0bd0fb353.tar.xz
android_bootable_recovery-e7b288824589b2828d83e1d47f6f12b0bd0fb353.tar.zst
android_bootable_recovery-e7b288824589b2828d83e1d47f6f12b0bd0fb353.zip
Diffstat (limited to 'uncrypt/uncrypt.c')
-rw-r--r--uncrypt/uncrypt.c7
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) {