aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-11-15 14:49:00 +0100
committerPaul Kocialkowski <contact@paulk.fr>2014-11-15 15:07:31 +0100
commit542bc494502ebef15aa5de544dc3d953b1127bfc (patch)
tree8196a257a91d713ba67bbd4c105e498d37796b4b /samsung-ipc
parentde0f59257da6e8b45ec3ce929c64c3d39d702b8e (diff)
downloadexternal_libsamsung-ipc-542bc494502ebef15aa5de544dc3d953b1127bfc.zip
external_libsamsung-ipc-542bc494502ebef15aa5de544dc3d953b1127bfc.tar.gz
external_libsamsung-ipc-542bc494502ebef15aa5de544dc3d953b1127bfc.tar.bz2
ipc_utils: ipc_data_dump string escape
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
-rw-r--r--samsung-ipc/ipc_utils.c16
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;