diff options
| author | 2008-07-30 20:38:36 -0700 | |
|---|---|---|
| committer | 2008-07-30 20:38:36 -0700 | |
| commit | 9e745d180199d39249305275bdc5242634671238 (patch) | |
| tree | 9b1e1af02a93ced705558c8b0f652058ddd3eaad | |
| parent | 1f81e7f15d0172a4ca5698155b3fef818f6212fb (diff) | |
| download | libimobiledevice-9e745d180199d39249305275bdc5242634671238.tar.gz libimobiledevice-9e745d180199d39249305275bdc5242634671238.tar.bz2 | |
Fixed a slight bug if datalen == bytes in usbmux.c
| -rw-r--r-- | src/usbmux.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/usbmux.c b/src/usbmux.c index 8c5fc34..7985b3a 100644 --- a/src/usbmux.c +++ b/src/usbmux.c | |||
| @@ -187,7 +187,8 @@ int mux_recv(iPhone *phone, usbmux_tcp_header *connection, char *data, uint32 da | |||
| 187 | } else {// all's good, they didn't do anything bonky. | 187 | } else {// all's good, they didn't do anything bonky. |
| 188 | my_datalen = ntohl(buffer[4]) - 28; | 188 | my_datalen = ntohl(buffer[4]) - 28; |
| 189 | connection->ocnt += my_datalen; | 189 | connection->ocnt += my_datalen; |
| 190 | memcpy(data, buffer+28, datalen); | 190 | if (bytes == (datalen+28)) memcpy(data, buffer+28, datalen); |
| 191 | else if (bytes == datalen) memcpy(data, buffer+28, datalen-28); | ||
| 191 | free(buffer); | 192 | free(buffer); |
| 192 | if (debug) printf("mux_recv: bytes received: %i\n", bytes - 28); | 193 | if (debug) printf("mux_recv: bytes received: %i\n", bytes - 28); |
| 193 | return bytes - 28; | 194 | return bytes - 28; |
