diff options
author | Martin Szulecki | 2014-12-09 14:52:26 +0100 |
---|---|---|
committer | Martin Szulecki | 2014-12-09 14:52:26 +0100 |
commit | e5795ac9abdecac6af43ef3c1e8bf636e8a70c13 (patch) | |
tree | fa71892d06c3f9433df827f59cec73236a8f62ec /src | |
parent | 05fa8d0a048cc92048a03eb06dd8883f9c76a632 (diff) | |
download | libimobiledevice-e5795ac9abdecac6af43ef3c1e8bf636e8a70c13.tar.gz libimobiledevice-e5795ac9abdecac6af43ef3c1e8bf636e8a70c13.tar.bz2 |
debugserver: Remove const argv requirement for creating commands
Diffstat (limited to 'src')
-rw-r--r-- | src/debugserver.c | 7 |
1 files changed, 5 insertions, 2 deletions
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_ return debugserver_client_receive_with_timeout(client, data, size, received, 1000); } -LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_new(const char* name, int argc, const char* argv[], debugserver_command_t* command) +LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_new(const char* name, int argc, char* argv[], debugserver_command_t* command) { int i; 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_ return DEBUGSERVER_E_INVALID_ARG; debugserver_error_t result = DEBUGSERVER_E_UNKNOWN_ERROR; - const char* env_arg[] = { env, NULL }; + char* env_tmp = strdup(env); + char* env_arg[2] = { env_tmp, NULL }; debugserver_command_t command = NULL; debugserver_command_new("QEnvironmentHexEncoded:", 1, env_arg, &command); result = debugserver_client_send_command(client, command, response); debugserver_command_free(command); + free(env_tmp); + return result; } |