diff options
| author | 2008-12-29 12:37:18 +0100 | |
|---|---|---|
| committer | 2009-01-02 09:55:08 -0800 | |
| commit | b30cd1dc05640ee6468b19e479162946a3722ac1 (patch) | |
| tree | dd63e2c128438774adad2542fbfb541a4f836b2c /src/AFC.c | |
| parent | d77ecbe3fbd73418dd72e147a0ac2a89e62b1cd9 (diff) | |
| download | libimobiledevice-b30cd1dc05640ee6468b19e479162946a3722ac1.tar.gz libimobiledevice-b30cd1dc05640ee6468b19e479162946a3722ac1.tar.bz2 | |
Some variables were unsigned while they should be
dispatch_AFC_packet returns an int, but it was sometimes incorrectly
assigned to a variable of type uint32_t which was then compared for
being less or more than 0.
Diffstat (limited to 'src/AFC.c')
| -rw-r--r-- | src/AFC.c | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -796,7 +796,9 @@ iphone_afc_write_file(iphone_afc_client_t client, iphone_afc_file_t file, | |||
| 796 | { | 796 | { |
| 797 | char *acknowledgement = NULL; | 797 | char *acknowledgement = NULL; |
| 798 | const int MAXIMUM_WRITE_SIZE = 1 << 15; | 798 | const int MAXIMUM_WRITE_SIZE = 1 << 15; |
| 799 | uint32 zero = 0, bytes_loc = 0, segments = (length / MAXIMUM_WRITE_SIZE), current_count = 0, i = 0; | 799 | uint32 zero = 0, current_count = 0, i = 0; |
| 800 | uint32 segments = (length / MAXIMUM_WRITE_SIZE); | ||
| 801 | int bytes_loc = 0; | ||
| 800 | char *out_buffer = NULL; | 802 | char *out_buffer = NULL; |
| 801 | 803 | ||
| 802 | if (!client || !client->afc_packet || !client->connection || !file || !bytes) | 804 | if (!client || !client->afc_packet || !client->connection || !file || !bytes) |
| @@ -927,7 +929,8 @@ iphone_error_t iphone_afc_close_file(iphone_afc_client_t client, iphone_afc_file | |||
| 927 | iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_t file, int seekpos) | 929 | iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_t file, int seekpos) |
| 928 | { | 930 | { |
| 929 | char *buffer = (char *) malloc(sizeof(char) * 24); | 931 | char *buffer = (char *) malloc(sizeof(char) * 24); |
| 930 | uint32 seekto = 0, bytes = 0, zero = 0; | 932 | uint32 seekto = 0, zero = 0; |
| 933 | int bytes = 0; | ||
| 931 | 934 | ||
| 932 | if (seekpos < 0) | 935 | if (seekpos < 0) |
| 933 | seekpos = file->size - abs(seekpos); | 936 | seekpos = file->size - abs(seekpos); |
| @@ -980,7 +983,8 @@ iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_ | |||
| 980 | iphone_error_t iphone_afc_truncate_file(iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize) | 983 | iphone_error_t iphone_afc_truncate_file(iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize) |
| 981 | { | 984 | { |
| 982 | char *buffer = (char *) malloc(sizeof(char) * 16); | 985 | char *buffer = (char *) malloc(sizeof(char) * 16); |
| 983 | uint32 bytes = 0, zero = 0; | 986 | int bytes = 0; |
| 987 | uint32 zero = 0; | ||
| 984 | 988 | ||
| 985 | afc_lock(client); | 989 | afc_lock(client); |
| 986 | 990 | ||
