Module: sip-router Branch: master Commit: 78a8bcd6030afc44c7c3cbc933278b1f2765b663 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=78a8bcd6...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Thu Dec 29 09:36:48 2011 +0100
mi_rpc: fixed warning of dereferencing type-punned pointer
---
modules/mi_rpc/mi_rpc_mod.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/mi_rpc/mi_rpc_mod.c b/modules/mi_rpc/mi_rpc_mod.c index 4bcd7c6..7a9bd77 100644 --- a/modules/mi_rpc/mi_rpc_mod.c +++ b/modules/mi_rpc/mi_rpc_mod.c @@ -513,7 +513,7 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) /* response will be malloced by binrpc_response_to_text. We do not free it. It must remain after this call. It will be reused by subsequent calls */ - static char *response = NULL; + static unsigned char *response = NULL; static int resp_len = 0; if (binrpc_open_connection_url(&rpc_handle, rpc_url) != 0) @@ -577,9 +577,9 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) { case 0: /* Success */ - binrpc_response_to_text(&resp_handle, (unsigned char **)&response, &resp_len, '\n'); - if (strlen(response) > 0) - result = init_mi_tree( 200, response, strlen(response) ); + binrpc_response_to_text(&resp_handle, &response, &resp_len, '\n'); + if (strlen((char*)response) > 0) + result = init_mi_tree( 200, (char*)response, strlen((char*)response) ); else /* Some functions don't give a text answer; use a default */ result = init_mi_tree( 200, MI_OK_S, MI_OK_LEN ); @@ -597,8 +597,8 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) } memcpy(response, resp, strlen(resp)); response[strlen(resp)]='\0'; - if (strlen(response) > 0) - result = init_mi_tree( resp_code, response, strlen(response) ); + if (strlen((char*)response) > 0) + result = init_mi_tree( resp_code, (char*)response, strlen((char*)response) ); else /* Some functions don't give a text answer; use a default */ result = init_mi_tree( resp_code, (char *)FAILED, strlen(FAILED) );