diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-11-15 14:49:00 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-11-15 15:07:31 +0100 |
commit | 542bc494502ebef15aa5de544dc3d953b1127bfc (patch) | |
tree | 8196a257a91d713ba67bbd4c105e498d37796b4b | |
parent | de0f59257da6e8b45ec3ce929c64c3d39d702b8e (diff) | |
download | external_libsamsung-ipc-542bc494502ebef15aa5de544dc3d953b1127bfc.zip external_libsamsung-ipc-542bc494502ebef15aa5de544dc3d953b1127bfc.tar.gz external_libsamsung-ipc-542bc494502ebef15aa5de544dc3d953b1127bfc.tar.bz2 |
ipc_utils: ipc_data_dump string escapereplicant-4.2-0003
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | samsung-ipc/ipc_utils.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/samsung-ipc/ipc_utils.c b/samsung-ipc/ipc_utils.c index a907e35..33860ce 100644 --- a/samsung-ipc/ipc_utils.c +++ b/samsung-ipc/ipc_utils.c @@ -358,7 +358,8 @@ int ipc_data_dump(struct ipc_client *client, const void *data, size_t size) unsigned int cols = 8; unsigned int cols_count = 2; int spacer; - char string[81]; + char string[81] = { 0 }; + char final[161] = { 0 }; size_t length; char *print; unsigned char *p; @@ -471,7 +472,18 @@ int ipc_data_dump(struct ipc_client *client, const void *data, size_t size) *print = '\0'; - ipc_client_log(client, string); + // Escape string + + j = 0; + + for (i = 0; i < sizeof(string); i++) { + if (string[i] == '%') + final[j++] = string[i]; + + final[j++] = string[i]; + } + + ipc_client_log(client, final); } return 0; |