summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-10-14 16:15:22 +0200
committerGravatar Martin Szulecki2014-10-14 16:15:22 +0200
commit96b15902e47900937561551282739d5a88396c61 (patch)
treebe353f97b9e522eea8c45fbe0d8c71ed96d93b70
parentfd43544a9251fcc698b0002967d45c251c203bb2 (diff)
downloadlibimobiledevice-96b15902e47900937561551282739d5a88396c61.tar.gz
libimobiledevice-96b15902e47900937561551282739d5a88396c61.tar.bz2
idevicedebug: Fix redeclaration and incrementation of environment_index
-rw-r--r--tools/idevicedebug.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c
index dcdb6b6..9e11f1f 100644
--- a/tools/idevicedebug.c
+++ b/tools/idevicedebug.c
@@ -224,6 +224,7 @@ int main(int argc, char *argv[])
char* working_directory = NULL;
char **newlist = NULL;
char** environment = NULL;
+ int environment_index = 0;
int environment_count = 0;
char* response = NULL;
debugserver_command_t command = NULL;
@@ -404,11 +405,9 @@ int main(int argc, char *argv[])
/* set environment */
if (environment) {
debug_info("Setting environment...");
- int environment_index = 0;
for (environment_index = 0; environment_index < environment_count; environment_index++) {
debug_info("setting environment variable: %s", environment[environment_index]);
debugserver_client_set_environment_hex_encoded(debugserver_client, environment[environment_index], NULL);
- environment_index++;
}
}
@@ -504,10 +503,8 @@ int main(int argc, char *argv[])
cleanup:
/* cleanup the house */
if (environment) {
- int environment_index = 0;
for (environment_index = 0; environment_index < environment_count; environment_index++) {
free(environment[environment_index]);
- environment_index++;
}
free(environment);
}