projects
/
pihpsdr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d2064a
)
bug fix: atoi() without properly terminating the string
author
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Tue, 4 Jan 2022 12:24:42 +0000
(17:54 +0530)
committer
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Tue, 4 Jan 2022 12:24:42 +0000
(17:54 +0530)
rigctl.c
patch
|
blob
|
history
diff --git
a/rigctl.c
b/rigctl.c
index 1fbf91f7e142e6b7d54c267de0f28f53c3ed9ea3..85b9c12262d1aae4955b8c714d6be92aa43fd471 100644
(file)
--- a/
rigctl.c
+++ b/
rigctl.c
@@
-955,9
+955,10
@@
gboolean parse_extended_cmd(char *command, CLIENT *client) {
sprintf(reply, "ZZAG%03d;", (int)(active_receiver->volume * 100.0));
send_resp(client->fd, reply);
} else {
- int gain = atoi(&command[4]);
- active_receiver->volume = (double)gain / 100.0;
- update_af_gain();
+ command[7] = '\0';
+ int gain = atoi(&command[4]);
+ active_receiver->volume = (double)gain / 100.0;
+ update_af_gain();
}
break;
case 'I': // ZZAI