summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-10-22 20:52:02 +0200
committerGravatar Martin Szulecki2014-10-22 22:21:06 +0200
commit57538472cb86d6b376f933e9e416eb769f7c00b7 (patch)
treee0cff41e2924c759295526e37d43086db664eb19 /tools
parent067c7c682614fbf0b7aeb13fd8b8ba7dc4fd8bf2 (diff)
downloadlibimobiledevice-57538472cb86d6b376f933e9e416eb769f7c00b7.tar.gz
libimobiledevice-57538472cb86d6b376f933e9e416eb769f7c00b7.tar.bz2
common: Move string_toupper() helper to utils and use it in idevicebackup tools
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicebackup.c12
-rw-r--r--tools/idevicebackup2.c12
2 files changed, 2 insertions, 22 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index 67d82fd..8260de6 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -224,16 +224,6 @@ static void notify_cb(const char *notification, void *userdata)
}
}
-static char *str_toupper(char* str)
-{
- char *res = strdup(str);
- unsigned int i;
- for (i = 0; i < strlen(res); i++) {
- res[i] = toupper(res[i]);
- }
- return res;
-}
-
static char* format_size_for_display(uint64_t size)
{
char buf[32];
@@ -295,7 +285,7 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid)
plist_dict_set_item(ret, "Target Identifier", plist_new_string(udid));
/* uppercase */
- udid_uppercase = str_toupper((char*)udid);
+ udid_uppercase = string_toupper((char*)udid);
plist_dict_set_item(ret, "Unique Identifier", plist_new_string(udid_uppercase));
free(udid_uppercase);
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 209dfe6..4fe5751 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -157,16 +157,6 @@ static void mobilebackup_afc_get_file_contents(afc_client_t afc, const char *fil
afc_file_close(afc, f);
}
-static char *str_toupper(char* str)
-{
- char *res = strdup(str);
- unsigned int i;
- for (i = 0; i < strlen(res); i++) {
- res[i] = toupper(res[i]);
- }
- return res;
-}
-
static int __mkdir(const char* path, int mode)
{
#ifdef WIN32
@@ -273,7 +263,7 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid, lockdownd_c
plist_dict_set_item(ret, "Target Type", plist_new_string("Device"));
/* uppercase */
- udid_uppercase = str_toupper((char*)udid);
+ udid_uppercase = string_toupper((char*)udid);
plist_dict_set_item(ret, "Unique Identifier", plist_new_string(udid_uppercase));
free(udid_uppercase);