From: Ramakrishnan Muthukrishnan Date: Wed, 12 Jan 2022 06:14:36 +0000 (+0530) Subject: send_reply() relies on strlen() to get the bytes to send, so terminate properly X-Git-Url: https://git.rkrishnan.org/Site/Content/simplejson/status?a=commitdiff_plain;h=e9514f065380123e58c5ea37080f158b36d23154;p=pihpsdr.git send_reply() relies on strlen() to get the bytes to send, so terminate properly --- diff --git a/rigctl.c b/rigctl.c index fc5c66b..0ff553b 100644 --- a/rigctl.c +++ b/rigctl.c @@ -1819,6 +1819,7 @@ gboolean parse_extended_cmd(char *command, CLIENT *client) { case 'G': // ZZMG // set/read mic gain if (command[4] == ';') { + memset(reply, \0, 9); sprintf(reply, "ZZMG%03d;", (int)(((mic_gain + 12.0) / 72.0) * 100.0)); send_resp(client->fd, reply); } else if (command[7] == ';') {