Loading recovery.cpp +36 −31 Original line number Original line Diff line number Diff line Loading @@ -1014,17 +1014,13 @@ static bool wipe_ab_device(size_t wipe_package_size) { } } static void choose_recovery_file(Device* device) { static void choose_recovery_file(Device* device) { if (!has_cache) { ui->Print("No /cache partition found.\n"); return; } // "Back" + KEEP_LOG_COUNT * 2 + terminating nullptr entry // "Back" + KEEP_LOG_COUNT * 2 + terminating nullptr entry char* entries[1 + KEEP_LOG_COUNT * 2 + 1]; char* entries[1 + KEEP_LOG_COUNT * 2 + 1]; memset(entries, 0, sizeof(entries)); memset(entries, 0, sizeof(entries)); unsigned int n = 0; unsigned int n = 0; if (has_cache) { // Add LAST_LOG_FILE + LAST_LOG_FILE.x // Add LAST_LOG_FILE + LAST_LOG_FILE.x // Add LAST_KMSG_FILE + LAST_KMSG_FILE.x // Add LAST_KMSG_FILE + LAST_KMSG_FILE.x for (int i = 0; i < KEEP_LOG_COUNT; i++) { for (int i = 0; i < KEEP_LOG_COUNT; i++) { Loading Loading @@ -1055,6 +1051,15 @@ static void choose_recovery_file(Device* device) { entries[n++] = kmsg_file; entries[n++] = kmsg_file; } } } } } else { // If cache partition is not found, view /tmp/recovery.log instead. ui->Print("No /cache partition found.\n"); if (access(TEMPORARY_LOG_FILE, R_OK) == -1) { return; } else{ entries[n++] = strdup(TEMPORARY_LOG_FILE); } } entries[n++] = strdup("Back"); entries[n++] = strdup("Back"); Loading Loading
recovery.cpp +36 −31 Original line number Original line Diff line number Diff line Loading @@ -1014,17 +1014,13 @@ static bool wipe_ab_device(size_t wipe_package_size) { } } static void choose_recovery_file(Device* device) { static void choose_recovery_file(Device* device) { if (!has_cache) { ui->Print("No /cache partition found.\n"); return; } // "Back" + KEEP_LOG_COUNT * 2 + terminating nullptr entry // "Back" + KEEP_LOG_COUNT * 2 + terminating nullptr entry char* entries[1 + KEEP_LOG_COUNT * 2 + 1]; char* entries[1 + KEEP_LOG_COUNT * 2 + 1]; memset(entries, 0, sizeof(entries)); memset(entries, 0, sizeof(entries)); unsigned int n = 0; unsigned int n = 0; if (has_cache) { // Add LAST_LOG_FILE + LAST_LOG_FILE.x // Add LAST_LOG_FILE + LAST_LOG_FILE.x // Add LAST_KMSG_FILE + LAST_KMSG_FILE.x // Add LAST_KMSG_FILE + LAST_KMSG_FILE.x for (int i = 0; i < KEEP_LOG_COUNT; i++) { for (int i = 0; i < KEEP_LOG_COUNT; i++) { Loading Loading @@ -1055,6 +1051,15 @@ static void choose_recovery_file(Device* device) { entries[n++] = kmsg_file; entries[n++] = kmsg_file; } } } } } else { // If cache partition is not found, view /tmp/recovery.log instead. ui->Print("No /cache partition found.\n"); if (access(TEMPORARY_LOG_FILE, R_OK) == -1) { return; } else{ entries[n++] = strdup(TEMPORARY_LOG_FILE); } } entries[n++] = strdup("Back"); entries[n++] = strdup("Back"); Loading