diff options
author | Martin Szulecki | 2014-10-14 16:18:10 +0200 |
---|---|---|
committer | Martin Szulecki | 2014-10-14 16:18:10 +0200 |
commit | 53fcc27add5dcd2112847cc46fd66c5e9f880007 (patch) | |
tree | 14e4c072d8228482f9b023c6385c23a970dc9873 | |
parent | 96b15902e47900937561551282739d5a88396c61 (diff) | |
download | libimobiledevice-53fcc27add5dcd2112847cc46fd66c5e9f880007.tar.gz libimobiledevice-53fcc27add5dcd2112847cc46fd66c5e9f880007.tar.bz2 |
idevicedebug: Fix broken logic when creating app arguments
-rw-r--r-- | tools/idevicedebug.c | 6 |
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++; } |