diff options
| -rw-r--r-- | libirecovery.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libirecovery.c b/libirecovery.c index 97432b7..c9e5949 100644 --- a/libirecovery.c +++ b/libirecovery.c | |||
| @@ -806,7 +806,7 @@ irecv_error_t irecv_getenv(irecv_client_t client, const char* variable, char** v | |||
| 806 | irecv_error_t irecv_getret(irecv_client_t client, unsigned int* value) { | 806 | irecv_error_t irecv_getret(irecv_client_t client, unsigned int* value) { |
| 807 | int ret = 0; | 807 | int ret = 0; |
| 808 | if (check_context(client) != IRECV_E_SUCCESS) return IRECV_E_NO_DEVICE; | 808 | if (check_context(client) != IRECV_E_SUCCESS) return IRECV_E_NO_DEVICE; |
| 809 | *value = NULL; | 809 | *value = 0; |
| 810 | 810 | ||
| 811 | char* response = (char*) malloc(256); | 811 | char* response = (char*) malloc(256); |
| 812 | if (response == NULL) { | 812 | if (response == NULL) { |
| @@ -816,7 +816,7 @@ irecv_error_t irecv_getret(irecv_client_t client, unsigned int* value) { | |||
| 816 | memset(response, '\0', 256); | 816 | memset(response, '\0', 256); |
| 817 | ret = irecv_control_transfer(client, 0xC0, 0, 0, 0, (unsigned char*) response, 255, 1000); | 817 | ret = irecv_control_transfer(client, 0xC0, 0, 0, 0, (unsigned char*) response, 255, 1000); |
| 818 | 818 | ||
| 819 | *value = response; | 819 | *value = (unsigned int) *response; |
| 820 | return IRECV_E_SUCCESS; | 820 | return IRECV_E_SUCCESS; |
| 821 | } | 821 | } |
| 822 | 822 | ||
