diff options
| author | 2014-10-14 16:15:22 +0200 | |
|---|---|---|
| committer | 2014-10-14 16:15:22 +0200 | |
| commit | 96b15902e47900937561551282739d5a88396c61 (patch) | |
| tree | be353f97b9e522eea8c45fbe0d8c71ed96d93b70 | |
| parent | fd43544a9251fcc698b0002967d45c251c203bb2 (diff) | |
| download | libimobiledevice-96b15902e47900937561551282739d5a88396c61.tar.gz libimobiledevice-96b15902e47900937561551282739d5a88396c61.tar.bz2 | |
idevicedebug: Fix redeclaration and incrementation of environment_index
| -rw-r--r-- | tools/idevicedebug.c | 5 |
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[]) | |||
| 224 | char* working_directory = NULL; | 224 | char* working_directory = NULL; |
| 225 | char **newlist = NULL; | 225 | char **newlist = NULL; |
| 226 | char** environment = NULL; | 226 | char** environment = NULL; |
| 227 | int environment_index = 0; | ||
| 227 | int environment_count = 0; | 228 | int environment_count = 0; |
| 228 | char* response = NULL; | 229 | char* response = NULL; |
| 229 | debugserver_command_t command = NULL; | 230 | debugserver_command_t command = NULL; |
| @@ -404,11 +405,9 @@ int main(int argc, char *argv[]) | |||
| 404 | /* set environment */ | 405 | /* set environment */ |
| 405 | if (environment) { | 406 | if (environment) { |
| 406 | debug_info("Setting environment..."); | 407 | debug_info("Setting environment..."); |
| 407 | int environment_index = 0; | ||
| 408 | for (environment_index = 0; environment_index < environment_count; environment_index++) { | 408 | for (environment_index = 0; environment_index < environment_count; environment_index++) { |
| 409 | debug_info("setting environment variable: %s", environment[environment_index]); | 409 | debug_info("setting environment variable: %s", environment[environment_index]); |
| 410 | debugserver_client_set_environment_hex_encoded(debugserver_client, environment[environment_index], NULL); | 410 | debugserver_client_set_environment_hex_encoded(debugserver_client, environment[environment_index], NULL); |
| 411 | environment_index++; | ||
| 412 | } | 411 | } |
| 413 | } | 412 | } |
| 414 | 413 | ||
| @@ -504,10 +503,8 @@ int main(int argc, char *argv[]) | |||
| 504 | cleanup: | 503 | cleanup: |
| 505 | /* cleanup the house */ | 504 | /* cleanup the house */ |
| 506 | if (environment) { | 505 | if (environment) { |
| 507 | int environment_index = 0; | ||
| 508 | for (environment_index = 0; environment_index < environment_count; environment_index++) { | 506 | for (environment_index = 0; environment_index < environment_count; environment_index++) { |
| 509 | free(environment[environment_index]); | 507 | free(environment[environment_index]); |
| 510 | environment_index++; | ||
| 511 | } | 508 | } |
| 512 | free(environment); | 509 | free(environment); |
| 513 | } | 510 | } |
