]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
small fixes in audio gain
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Wed, 12 Jan 2022 07:07:03 +0000 (12:37 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Wed, 12 Jan 2022 07:07:03 +0000 (12:37 +0530)
rigctl.c

index c2b78127daf87e93bcc228967cd4d2b30899b8ea..7c616229631a39eb2520ab34bfd1fe9c6f76534d 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -953,11 +953,12 @@ gboolean parse_extended_cmd(char *command, CLIENT *client) {
       // read/set audio gain
       if (command[4] == ';') {
         // send reply back
+        memset(reply, '\0', 9);
         sprintf(reply, "ZZAG%03d;", (int)(active_receiver->volume * 100.0));
         send_resp(client->fd, reply);
       } else if (command[7] == ';') {
           command[7] = '\0';
-          int gain = atoi(&command[4]);
+          int gain = strtol(&command[4], NULL, 10);
           active_receiver->volume = (double)gain / 100.0;
           update_af_gain();
       }