]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
send_reply() relies on strlen() to get the bytes to send, so terminate properly
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Wed, 12 Jan 2022 06:14:36 +0000 (11:44 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Wed, 12 Jan 2022 06:14:36 +0000 (11:44 +0530)
rigctl.c

index fc5c66b5ccc398ced5494aed0c083335da4482b4..0ff553b4222e41b34a38efd2c83fccb26da21d5a 100644 (file)
--- 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] == ';') {