From bbb604db064d31b21d3306dd12535694194a9481 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Fri, 24 Jul 2020 20:49:39 +0200 Subject: [PATCH] Use send_handshake_query inside send_lazy_switch --- src/client.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/client.c b/src/client.c index 9e2a41d..a36c5b4 100644 --- a/src/client.c +++ b/src/client.c @@ -1317,21 +1317,12 @@ send_downenctest(int fd, char downenc, int variant) static void send_lazy_switch(int fd, int userid) { - char buf[512] = "o_____."; - buf[1] = b32_5to8(userid); + char sw_lazy[] = { 'o', b32_5to8(userid), 'i', 0 }; if (lazymode) - buf[2] = 'l'; - else - buf[2] = 'i'; + sw_lazy[2] = 'l'; - buf[3] = b32_5to8((rand_seed >> 10) & 0x1f); - buf[4] = b32_5to8((rand_seed >> 5) & 0x1f); - buf[5] = b32_5to8((rand_seed) & 0x1f); - rand_seed++; - - strncat(buf, topdomain, 512 - strlen(buf)); - send_query(fd, buf); + send_handshake_query(fd, sw_lazy); } static int