summaryrefslogtreecommitdiffstats
path: root/src/recovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/recovery.c')
-rw-r--r--src/recovery.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/recovery.c b/src/recovery.c
index a0a1151..e67b10d 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -132,15 +132,15 @@ int recovery_open_with_timeout(irecv_client_t* client) {
int i = 0;
int attempts = 10;
irecv_client_t recovery = NULL;
- irecv_error_t recovery_error = IRECV_E_SUCCESS;
+ irecv_error_t recovery_error = IRECV_E_UNKNOWN_ERROR;
for (i = 1; i <= attempts; i++) {
- recovery_error = irecv_open(client);
+ recovery_error = irecv_open(&recovery);
if (recovery_error == IRECV_E_SUCCESS) {
break;
}
- if (i == attempts) {
+ if (i >= attempts) {
error("ERROR: Unable to connect to device in recovery mode\n");
return -1;
}