From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Wed, 12 Jan 2022 06:57:18 +0000 (+0530)
Subject: strtol instead of atoi
X-Git-Url: https://git.rkrishnan.org/vdrive/components/?a=commitdiff_plain;h=1bb52198766bd3acbfd1fe5010e2d52817b64030;p=pihpsdr.git

strtol instead of atoi
---

diff --git a/rigctl.c b/rigctl.c
index b09a497..c2b7812 100644
--- a/rigctl.c
+++ b/rigctl.c
@@ -1824,8 +1824,8 @@ gboolean parse_extended_cmd(char *command, CLIENT *client) {
             send_resp(client->fd, reply);
         } else if (command[7] == ';') {
             command[7] = '\0';
-            double gain = (double)atoi(&command[4]);
-            gain = (((gain / 100.0) * 62.0) - 12.0);
+            double gain = (double)strtol(&command[4], NULL, 10);
+            gain = (gain * 62.0 / 100.0) - 12.0;
             set_mic_gain(gain);
         }
         break;