summaryrefslogtreecommitdiffstats
path: root/src/libirecovery.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2015-12-31 19:53:09 +0100
committerGravatar Nikias Bassen2015-12-31 19:53:09 +0100
commit166af423e44039a6f17d46d171cd90fcbee393aa (patch)
treee8b21484a36dec631bd943f0f638f79e55a5035b /src/libirecovery.c
parentf04314a191afa506d6705d65bc7464a8c143fbc2 (diff)
downloadlibirecovery-166af423e44039a6f17d46d171cd90fcbee393aa.tar.gz
libirecovery-166af423e44039a6f17d46d171cd90fcbee393aa.tar.bz2
Fix iokit_get_string_descriptor_ascii by returning the size of the string
Diffstat (limited to 'src/libirecovery.c')
-rw-r--r--src/libirecovery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c
index d80d8cc..9284316 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -249,6 +249,7 @@ static int iokit_get_string_descriptor_ascii(irecv_client_t client, uint8_t desc
request.wIndex = 0; // All languages 0x409; // language
request.wLength = sizeof(descriptor) - 1;
request.pData = descriptor;
+ request.wLenDone = 0;
result = (*client->handle)->DeviceRequest(client->handle, &request);
if (result == kIOReturnNoDevice)
@@ -262,6 +263,7 @@ static int iokit_get_string_descriptor_ascii(irecv_client_t client, uint8_t desc
request.wValue = (kUSBStringDesc << 8) | desc_index;
request.wIndex = descriptor[2] + (descriptor[3] << 8);
+ request.wLenDone = 0;
result = (*client->handle)->DeviceRequest(client->handle, &request);
if (result == kIOReturnNoDevice)
@@ -277,7 +279,7 @@ static int iokit_get_string_descriptor_ascii(irecv_client_t client, uint8_t desc
}
buffer[j] = 0;
- return IRECV_E_SUCCESS;
+ return request.wLenDone;
}
return IRECV_E_UNKNOWN_ERROR;
}