diff options
Diffstat (limited to 'adb/usb_windows.c')
-rw-r--r-- | adb/usb_windows.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/adb/usb_windows.c b/adb/usb_windows.c index 4936b77..b7ad913 100644 --- a/adb/usb_windows.c +++ b/adb/usb_windows.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include <winsock2.h> #include <windows.h> #include <winerror.h> #include <errno.h> @@ -310,14 +311,14 @@ int usb_read(usb_handle *handle, void* data, int len) { int xfer = (len > 4096) ? 4096 : len; ret = AdbReadEndpointSync(handle->adb_read_pipe, - (void*)data, + data, (unsigned long)xfer, &read, time_out); int saved_errno = GetLastError(); D("usb_write got: %ld, expected: %d, errno: %d\n", read, xfer, saved_errno); if (ret) { - data += read; + data = (char *)data + read; len -= read; if (len == 0) |