diff options
| author | 2014-12-09 14:52:26 +0100 | |
|---|---|---|
| committer | 2014-12-09 14:52:26 +0100 | |
| commit | e5795ac9abdecac6af43ef3c1e8bf636e8a70c13 (patch) | |
| tree | fa71892d06c3f9433df827f59cec73236a8f62ec | |
| parent | 05fa8d0a048cc92048a03eb06dd8883f9c76a632 (diff) | |
| download | libimobiledevice-e5795ac9abdecac6af43ef3c1e8bf636e8a70c13.tar.gz libimobiledevice-e5795ac9abdecac6af43ef3c1e8bf636e8a70c13.tar.bz2 | |
debugserver: Remove const argv requirement for creating commands
| -rw-r--r-- | include/libimobiledevice/debugserver.h | 2 | ||||
| -rw-r--r-- | src/debugserver.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/libimobiledevice/debugserver.h b/include/libimobiledevice/debugserver.h index 3b1969a..3626182 100644 --- a/include/libimobiledevice/debugserver.h +++ b/include/libimobiledevice/debugserver.h | |||
| @@ -195,7 +195,7 @@ debugserver_error_t debugserver_client_set_environment_hex_encoded(debugserver_c | |||
| 195 | * @return DEBUGSERVER_E_SUCCESS on success, | 195 | * @return DEBUGSERVER_E_SUCCESS on success, |
| 196 | * DEBUGSERVER_E_INVALID_ARG when name or command is NULL | 196 | * DEBUGSERVER_E_INVALID_ARG when name or command is NULL |
| 197 | */ | 197 | */ |
| 198 | debugserver_error_t debugserver_command_new(const char* name, int argc, const char* argv[], debugserver_command_t* command); | 198 | debugserver_error_t debugserver_command_new(const char* name, int argc, char* argv[], debugserver_command_t* command); |
| 199 | 199 | ||
| 200 | /** | 200 | /** |
| 201 | * Frees memory of command object. | 201 | * Frees memory of command object. |
diff --git a/src/debugserver.c b/src/debugserver.c index 37b54de..e653a8e 100644 --- a/src/debugserver.c +++ b/src/debugserver.c | |||
| @@ -153,7 +153,7 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive(debugserver_ | |||
| 153 | return debugserver_client_receive_with_timeout(client, data, size, received, 1000); | 153 | return debugserver_client_receive_with_timeout(client, data, size, received, 1000); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_new(const char* name, int argc, const char* argv[], debugserver_command_t* command) | 156 | LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_new(const char* name, int argc, char* argv[], debugserver_command_t* command) |
| 157 | { | 157 | { |
| 158 | int i; | 158 | int i; |
| 159 | debugserver_command_t tmp = (debugserver_command_t) malloc(sizeof(struct debugserver_command_private)); | 159 | debugserver_command_t tmp = (debugserver_command_t) malloc(sizeof(struct debugserver_command_private)); |
| @@ -541,13 +541,16 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_environment_hex_ | |||
| 541 | return DEBUGSERVER_E_INVALID_ARG; | 541 | return DEBUGSERVER_E_INVALID_ARG; |
| 542 | 542 | ||
| 543 | debugserver_error_t result = DEBUGSERVER_E_UNKNOWN_ERROR; | 543 | debugserver_error_t result = DEBUGSERVER_E_UNKNOWN_ERROR; |
| 544 | const char* env_arg[] = { env, NULL }; | 544 | char* env_tmp = strdup(env); |
| 545 | char* env_arg[2] = { env_tmp, NULL }; | ||
| 545 | 546 | ||
| 546 | debugserver_command_t command = NULL; | 547 | debugserver_command_t command = NULL; |
| 547 | debugserver_command_new("QEnvironmentHexEncoded:", 1, env_arg, &command); | 548 | debugserver_command_new("QEnvironmentHexEncoded:", 1, env_arg, &command); |
| 548 | result = debugserver_client_send_command(client, command, response); | 549 | result = debugserver_client_send_command(client, command, response); |
| 549 | debugserver_command_free(command); | 550 | debugserver_command_free(command); |
| 550 | 551 | ||
| 552 | free(env_tmp); | ||
| 553 | |||
| 551 | return result; | 554 | return result; |
| 552 | } | 555 | } |
| 553 | 556 | ||
