From 3b2e1125e2118cd72adaddd8cde82770aeac0866 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Thu, 9 Aug 2018 20:31:02 +0200 Subject: [PATCH] ipc: "improve" code This code is strange but now a bit less --- src/bin/ipc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/ipc.c b/src/bin/ipc.c index 86081b52..c9b9ee73 100644 --- a/src/bin/ipc.c +++ b/src/bin/ipc.c @@ -38,7 +38,7 @@ _ipc_cb_client_data(void *_data EINA_UNUSED, static char * _ipc_hash_get(void) { - char buf[1024], hash[64]; + char buf[1024], hash[64] = {}; const char *disp, *session, *xdg_session, *xdg_id, *xdg_seat, *xdg_vt; char *s; unsigned int i; @@ -60,9 +60,8 @@ _ipc_hash_get(void) snprintf(buf, sizeof(buf), "%s.%s.%s.%s.%s.%s", disp, session, xdg_session, xdg_id, xdg_seat, xdg_vt); - memset(hash, 0, sizeof(hash)); - memset(hash, 'x', 12 + 32); memcpy(hash, "terminology-", 12); + memset(hash+12, 'x', 32); for (i = 0, s = buf; *s; s++) { c1 = (((unsigned char)*s) >> 4) & 0xf;