summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {