diff options
| author | 2012-03-21 14:55:15 +0100 | |
|---|---|---|
| committer | 2012-03-21 14:55:15 +0100 | |
| commit | 662ef2073cb5ece7bb558700f344ea10b431fb64 (patch) | |
| tree | 9a2289cb95a2cd89cf12651a18274a0c0f51a96e | |
| parent | f322dfcb9718b80f9410ebafd8d159e5fc116a88 (diff) | |
| download | libimobiledevice-662ef2073cb5ece7bb558700f344ea10b431fb64.tar.gz libimobiledevice-662ef2073cb5ece7bb558700f344ea10b431fb64.tar.bz2 | |
tools: Fix compiler warnings for idevicebackup and idevicebackup2
| -rw-r--r-- | tools/idevicebackup.c | 6 | ||||
| -rw-r--r-- | tools/idevicebackup2.c | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 159f3b1..26771f8 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | #include <gcrypt.h> | 35 | #include <gcrypt.h> |
| 36 | #endif | 36 | #endif |
| 37 | #include <unistd.h> | 37 | #include <unistd.h> |
| 38 | #include <ctype.h> | ||
| 39 | #include <time.h> | ||
| 38 | 40 | ||
| 39 | #include <libimobiledevice/libimobiledevice.h> | 41 | #include <libimobiledevice/libimobiledevice.h> |
| 40 | #include <libimobiledevice/lockdown.h> | 42 | #include <libimobiledevice/lockdown.h> |
| @@ -228,14 +230,14 @@ static void notify_cb(const char *notification, void *userdata) | |||
| 228 | static char *str_toupper(char* str) | 230 | static char *str_toupper(char* str) |
| 229 | { | 231 | { |
| 230 | char *res = strdup(str); | 232 | char *res = strdup(str); |
| 231 | int i; | 233 | unsigned int i; |
| 232 | for (i = 0; i < strlen(res); i++) { | 234 | for (i = 0; i < strlen(res); i++) { |
| 233 | res[i] = toupper(res[i]); | 235 | res[i] = toupper(res[i]); |
| 234 | } | 236 | } |
| 235 | return res; | 237 | return res; |
| 236 | } | 238 | } |
| 237 | 239 | ||
| 238 | char* build_path(const char* elem, ...) | 240 | static char* build_path(const char* elem, ...) |
| 239 | { | 241 | { |
| 240 | if (!elem) return NULL; | 242 | if (!elem) return NULL; |
| 241 | va_list args; | 243 | va_list args; |
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 2c77e1f..b0f9d55 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -28,6 +28,8 @@ | |||
| 28 | #include <unistd.h> | 28 | #include <unistd.h> |
| 29 | #include <dirent.h> | 29 | #include <dirent.h> |
| 30 | #include <libgen.h> | 30 | #include <libgen.h> |
| 31 | #include <ctype.h> | ||
| 32 | #include <time.h> | ||
| 31 | 33 | ||
| 32 | #include <libimobiledevice/libimobiledevice.h> | 34 | #include <libimobiledevice/libimobiledevice.h> |
| 33 | #include <libimobiledevice/lockdown.h> | 35 | #include <libimobiledevice/lockdown.h> |
| @@ -161,7 +163,7 @@ static void mobilebackup_afc_get_file_contents(const char *filename, char **data | |||
| 161 | static char *str_toupper(char* str) | 163 | static char *str_toupper(char* str) |
| 162 | { | 164 | { |
| 163 | char *res = strdup(str); | 165 | char *res = strdup(str); |
| 164 | int i; | 166 | unsigned int i; |
| 165 | for (i = 0; i < strlen(res); i++) { | 167 | for (i = 0; i < strlen(res); i++) { |
| 166 | res[i] = toupper(res[i]); | 168 | res[i] = toupper(res[i]); |
| 167 | } | 169 | } |
| @@ -177,7 +179,7 @@ static int __mkdir(const char* path, int mode) | |||
| 177 | #endif | 179 | #endif |
| 178 | } | 180 | } |
| 179 | 181 | ||
| 180 | int mkdir_with_parents(const char *dir, int mode) | 182 | static int mkdir_with_parents(const char *dir, int mode) |
| 181 | { | 183 | { |
| 182 | if (!dir) return -1; | 184 | if (!dir) return -1; |
| 183 | if (__mkdir(dir, mode) == 0) { | 185 | if (__mkdir(dir, mode) == 0) { |
| @@ -200,7 +202,7 @@ int mkdir_with_parents(const char *dir, int mode) | |||
| 200 | return res; | 202 | return res; |
| 201 | } | 203 | } |
| 202 | 204 | ||
| 203 | char* build_path(const char* elem, ...) | 205 | static char* build_path(const char* elem, ...) |
| 204 | { | 206 | { |
| 205 | if (!elem) return NULL; | 207 | if (!elem) return NULL; |
| 206 | va_list args; | 208 | va_list args; |
| @@ -1662,7 +1664,6 @@ checkpoint: | |||
| 1662 | if (src && dst) { | 1664 | if (src && dst) { |
| 1663 | char *oldpath = build_path(backup_directory, src, NULL); | 1665 | char *oldpath = build_path(backup_directory, src, NULL); |
| 1664 | char *newpath = build_path(backup_directory, dst, NULL); | 1666 | char *newpath = build_path(backup_directory, dst, NULL); |
| 1665 | struct stat st; | ||
| 1666 | 1667 | ||
| 1667 | PRINT_VERBOSE(1, "Copying '%s' to '%s'\n", src, dst); | 1668 | PRINT_VERBOSE(1, "Copying '%s' to '%s'\n", src, dst); |
| 1668 | 1669 | ||
