summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-10-14 16:18:10 +0200
committerGravatar Martin Szulecki2014-10-14 16:18:10 +0200
commit53fcc27add5dcd2112847cc46fd66c5e9f880007 (patch)
tree14e4c072d8228482f9b023c6385c23a970dc9873 /tools
parent96b15902e47900937561551282739d5a88396c61 (diff)
downloadlibimobiledevice-53fcc27add5dcd2112847cc46fd66c5e9f880007.tar.gz
libimobiledevice-53fcc27add5dcd2112847cc46fd66c5e9f880007.tar.bz2
idevicedebug: Fix broken logic when creating app arguments
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicedebug.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c
index 9e11f1f..9d0c561 100644
--- a/tools/idevicedebug.c
+++ b/tools/idevicedebug.c
@@ -413,14 +413,14 @@ int main(int argc, char *argv[])
/* set arguments and run app */
debug_info("Setting argv...");
- int app_argc = (argc - i + 2);
- debug_info("app_argc: %d", app_argc);
+ i++; /* i is the offset of the bundle identifier, thus skip it */
+ int app_argc = (argc - i + 1);
char **app_argv = (char**)malloc(sizeof(char*) * app_argc);
app_argv[0] = path;
debug_info("app_argv[%d] = %s", 0, app_argv[0]);
app_argc = 1;
while (i < argc && argv && argv[i]) {
- debug_info("app_argv[%d] = argv[%d]: %s", app_argc, i, argv[i]);
+ debug_info("app_argv[%d] = %s", app_argc, argv[i]);
app_argv[app_argc++] = argv[i];
i++;
}