summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
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[])
413 413
414 /* set arguments and run app */ 414 /* set arguments and run app */
415 debug_info("Setting argv..."); 415 debug_info("Setting argv...");
416 int app_argc = (argc - i + 2); 416 i++; /* i is the offset of the bundle identifier, thus skip it */
417 debug_info("app_argc: %d", app_argc); 417 int app_argc = (argc - i + 1);
418 char **app_argv = (char**)malloc(sizeof(char*) * app_argc); 418 char **app_argv = (char**)malloc(sizeof(char*) * app_argc);
419 app_argv[0] = path; 419 app_argv[0] = path;
420 debug_info("app_argv[%d] = %s", 0, app_argv[0]); 420 debug_info("app_argv[%d] = %s", 0, app_argv[0]);
421 app_argc = 1; 421 app_argc = 1;
422 while (i < argc && argv && argv[i]) { 422 while (i < argc && argv && argv[i]) {
423 debug_info("app_argv[%d] = argv[%d]: %s", app_argc, i, argv[i]); 423 debug_info("app_argv[%d] = %s", app_argc, argv[i]);
424 app_argv[app_argc++] = argv[i]; 424 app_argv[app_argc++] = argv[i];
425 i++; 425 i++;
426 } 426 }