diff options
author | Martin Szulecki | 2014-10-22 20:48:00 +0200 |
---|---|---|
committer | Martin Szulecki | 2014-10-22 22:21:06 +0200 |
commit | 067c7c682614fbf0b7aeb13fd8b8ba7dc4fd8bf2 (patch) | |
tree | 0330ac9d1dee43f6fbefd85c684d1dab3ad4220f /tools/idevicebackup.c | |
parent | 744ffa6da4839f4118b585f942985b3330ad3a32 (diff) | |
download | libimobiledevice-067c7c682614fbf0b7aeb13fd8b8ba7dc4fd8bf2.tar.gz libimobiledevice-067c7c682614fbf0b7aeb13fd8b8ba7dc4fd8bf2.tar.bz2 |
common: Share idevicebackup helper string_build_path() from utils
Diffstat (limited to 'tools/idevicebackup.c')
-rw-r--r-- | tools/idevicebackup.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index c5315d2..67d82fd 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c @@ -234,33 +234,6 @@ static char *str_toupper(char* str) return res; } -static char* build_path(const char* elem, ...) -{ - if (!elem) return NULL; - va_list args; - int len = strlen(elem)+1; - va_start(args, elem); - char *arg = va_arg(args, char*); - while (arg) { - len += strlen(arg)+1; - arg = va_arg(args, char*); - } - va_end(args); - - char* out = (char*)malloc(len); - strcpy(out, elem); - - va_start(args, elem); - arg = va_arg(args, char*); - while (arg) { - strcat(out, "/"); - strcat(out, arg); - arg = va_arg(args, char*); - } - va_end(args); - return out; -} - static char* format_size_for_display(uint64_t size) { char buf[32]; @@ -370,7 +343,7 @@ static char *mobilebackup_build_path(const char *backup_directory, const char *n strcpy(filename, name); if (extension != NULL) strcat(filename, extension); - char *path = build_path(backup_directory, filename, NULL); + char *path = string_build_path(backup_directory, filename, NULL); free(filename); return path; } |